Trying to access array offset on value of type bool on line 75 #2

Closed
opened 2022-12-02 05:15:01 -06:00 by musicpanda · 1 comment
musicpanda commented 2022-12-02 05:15:01 -06:00 (Migrated from github.com)

In my errorlog I find warnings like the following

[Thu Dec 01 17:28:54.432014 2022] [php:warn] [pid 7404] [client 12234] PHP Warning: Trying to access array offset on value of type bool in /sites/www.shop.com/modules/sendtoafriend/sendtoafriend.php on line 75,

When I check the code I see the following:
friend

My guess is that this concerns products without an image.

In my errorlog I find warnings like the following > [Thu Dec 01 17:28:54.432014 2022] [php:warn] [pid 7404] [client 12234] PHP Warning: Trying to access array offset on value of type bool in /sites/www.shop.com/modules/sendtoafriend/sendtoafriend.php on line 75, When I check the code I see the following: ![friend](https://user-images.githubusercontent.com/13930107/205280131-209d483f-2a19-4ff0-a6f7-d71c4c1e577e.jpg) My guess is that this concerns products without an image.
getdatakick commented 2022-12-02 06:53:03 -06:00 (Migrated from github.com)

Right, the image probably doesn't exists. We should fix this by conditional check.

Also, using image identifiers in format {productId}_{imageId} is no longer needed, and is actually deprecated. We should simply pass image id, without the product prefix.

Right, the image probably doesn't exists. We should fix this by conditional check. Also, using image identifiers in format `{productId}_{imageId}` is no longer needed, and is actually deprecated. We should simply pass image id, without the product prefix.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-thirtybees/sendtoafriend#2
No description provided.