Hi, my website has been functioning well for a long time and now realised that when I click on the Special link on the footer I get the following errors.
Notice: Trying to access array offset on value of type bool in product/special.php on line 84 ...... to product/special.php on line 124
Is this the problem of OC3.0.3.1 and why is this happening? And how can I fix it?
Many thanks,
Morty
Could be cause by an extension that modifies getProduct() in catalog/model/catalog/product.php. What theme and extensions are you using? Try disabling them one by one to see if one is causing the error.
It also looks like you have display errors on. You should never have error display on on a live production site.
You need make sure display errors in set to off in all 3 places. Your PHP settings, in system/config/default.php and in the settings. Not only can this cause minor notices and warnings to cause bigger errors, as you have seen, it can also be a security risk.
1. In your PHP settings make sure display_errors is set to Off. Use phpinfo() to check. It should be off by default, but there are lots of rubbish hosts out there.
2. In system/config/default.php set error_display to false.
3. In your OpenCart Setting on the server tab set Display Errors to No.
It also looks like you have display errors on. You should never have error display on on a live production site.
You need make sure display errors in set to off in all 3 places. Your PHP settings, in system/config/default.php and in the settings. Not only can this cause minor notices and warnings to cause bigger errors, as you have seen, it can also be a security risk.
1. In your PHP settings make sure display_errors is set to Off. Use phpinfo() to check. It should be off by default, but there are lots of rubbish hosts out there.
2. In system/config/default.php set error_display to false.
3. In your OpenCart Setting on the server tab set Display Errors to No.
Many thanks, very valuable advice about the errors display!
I still get the same error in system maintenance settings after viewing the special page event after disabling all the extensions, refreshing all the cache and clearing all the logs.
I've checked the phpinfo.php and all the error displays are disabled now, then deleted the phpinfo.php.
I still get the same error in system maintenance settings after viewing the special page event after disabling all the extensions, refreshing all the cache and clearing all the logs.
I've checked the phpinfo.php and all the error displays are disabled now, then deleted the phpinfo.php.
Last edited by parkookk on Wed Nov 02, 2022 5:27 pm, edited 1 time in total.
If you don't think it's an extension is could be an issue with a product missing a product description of entry in the database.
Thanks, when I go to https://www.mediasos.co.uk/index.php?ro ... ct/special there is a product that has no title, image, etc., it's very strange!! I checked all my products in admin page and they all have proper titling.
Any idea what's going on?
Thanks
Any idea what's going on?
Thanks
It says not product found.parkookk wrote: ↑Thu Nov 03, 2022 10:29 pmThanks, when I go to https://www.mediasos.co.uk/index.php?ro ... ct/special there is a product that has no title, image, etc., it's very strange!! I checked all my products in admin page and they all have proper titling.
Any idea what's going on?
Thanks
https://prnt.sc/BBTxeOvs6718
My best guess is that one of your products is missing an entry in the product_description table in the database. You could check your database has the same number of entries as the product table.
Yes, that happens when you click on that blank/unusual product. So how that has gone there?Majnoon wrote: ↑Thu Nov 03, 2022 11:03 pmIt says not product found.parkookk wrote: ↑Thu Nov 03, 2022 10:29 pmThanks, when I go to https://www.mediasos.co.uk/index.php?ro ... ct/special there is a product that has no title, image, etc., it's very strange!! I checked all my products in admin page and they all have proper titling.
Any idea what's going on?
Thanks
https://prnt.sc/BBTxeOvs6718
Thanks,ADD Creative wrote: ↑Fri Nov 04, 2022 1:33 amMy best guess is that one of your products is missing an entry in the product_description table in the database. You could check your database has the same number of entries as the product table.
I used phpMyAdming and product_description had 117 and product had 118 entries. Then I logged in to my Admin and can see 117 products.
Can you please explain what should I do now?
Try this SQL to see the product. Then edit any product in the admin to set the description.parkookk wrote: ↑Fri Mar 24, 2023 1:40 amThanks,ADD Creative wrote: ↑Fri Nov 04, 2022 1:33 amMy best guess is that one of your products is missing an entry in the product_description table in the database. You could check your database has the same number of entries as the product table.
I used phpMyAdming and product_description had 117 and product had 118 entries. Then I logged in to my Admin and can see 117 products.
Can you please explain what should I do now?
Code: Select all
SELECT * FROM oc_product p WHERE NOT EXISTS (SELECT * FROM oc_product_description pd WHERE p.product_id = pd.product_id)
Thanks "ADD Creative" , you're a legend. I found the one and it was an old product that use to have special offer and it has been removed. So I have deleted the extra entry in the "product" and all looking alright now.ADD Creative wrote: ↑Fri Mar 24, 2023 1:53 amTry this SQL to see the product. Then edit any product in the admin to set the description.parkookk wrote: ↑Fri Mar 24, 2023 1:40 amThanks,ADD Creative wrote: ↑Fri Nov 04, 2022 1:33 amMy best guess is that one of your products is missing an entry in the product_description table in the database. You could check your database has the same number of entries as the product table.
I used phpMyAdming and product_description had 117 and product had 118 entries. Then I logged in to my Admin and can see 117 products.
Can you please explain what should I do now?Code: Select all
SELECT * FROM oc_product p WHERE NOT EXISTS (SELECT * FROM oc_product_description pd WHERE p.product_id = pd.product_id)
Who is online
Users browsing this forum: No registered users and 104 guests