FuelSDK-PHP icon indicating copy to clipboard operation
FuelSDK-PHP copied to clipboard

[BUG] Trying to access array offset on value of type null in ET_Client.php on line 645

Open Armandulis opened this issue 1 year ago • 0 comments

Describe the bug PHP shows warning PHP Warning: Trying to access array offset on value of type null in ../vendor/salesforce-mc/fuel-sdk-php/src/ET_Client.php on line 645 when assigning ET_Client to ET_Subscriber->authStub. This is flooding our logs and making a lot of unnecessary notification about the warnings. Doe not actually stop the functionality, it's just the warning.

To Reproduce

  1. Create new ET_Subscriber
  2. Authenticate create new ET_Client (as well as all of the authentication for ET_Client)
  3. Assign ET_Client to ET_Subscribers::authStub
  4. Warning is displayed

Expected behavior I should not see the warning.

Screenshots image

Code snippet

    $this->Subscriber = $ETSubscriber ?? FrontController::container()->get( ET_Subscriber::class );
    $this->Subscriber->authStub = $Client ?? FrontController::container()->get( ET_Client::class ); // First you need to authenticate the ET Client (just passing credentials to constructor)

Environment

  • SDK Version: 1.4.0
  • PHP version: 8.0.28

The bug has the severity

  • [ ] Critical: The defect affects critical functionality or critical data. It does not have a workaround.
  • [ ] Major: The defect affects major functionality or major data. It has a workaround but is not obvious and is difficult.
  • [ ] Minor: The defect affects minor functionality or non-critical data. It has an easy workaround.
  • [X] Trivial: The defect does not affect functionality or data. It does not even need a workaround. It does not impact productivity or efficiency. It is merely an inconvenience.

Additional context Add any other context about the problem here.

Armandulis avatar Jun 15 '23 07:06 Armandulis