Hello,
We are currently having an issue with our website where customers are having the below code appear when on our site:
Notice: Trying to access array offset on value of type bool in /customers/3/5/a/security-hardware.co.uk/httpd.www/system/library/tax.php on line 11Notice: Trying to access array offset on value of type bool in /customers/3/5/a/security-hardware.co.uk/httpd.www/system/library/tax.php on line 11
Line 11 Code - $this->setShippingAddress($this->session->data['shipping_address']['country_id'], $this->session->data['shipping_address']['zone_id']);
We currently run OC on v 2.1.0.1 and are on PhP version 7.4 due to some plugins which don't quite work with the later versions.
Can someone assist with any changes which may need to be made to the line of code in order to solve the issue?
Thanks in advance!
It's just a notice,. but if you are seeing it on screen, then you probably have display errors on. Not only will this cause problems like the one you are seeing, it is also a security risk. You need to ensure display errors is switched off in three places.
In the settings.
In system/config/default.php.
In you PHP configuration. Should be off by default, but there are some bad server configurations out there. Use phpinfo() to check.
If you want to stop the log file filling up try in system/library/tax.php changing.
To.
And the same for payment_address.
In the settings.
In system/config/default.php.
In you PHP configuration. Should be off by default, but there are some bad server configurations out there. Use phpinfo() to check.
If you want to stop the log file filling up try in system/library/tax.php changing.
Code: Select all
if (isset($this->session->data['shipping_address'])) {
Code: Select all
if (isset($this->session->data['shipping_address']['country_id']) && isset($this->session->data['shipping_address']['zone_id'])) {
Thanks for your reply. I've turned it off in the System settings, so isn't showing on the page any more. It may sound a daft question but by not displaying the error logs, this won't cause any further issues?
In terms of the phpinfo(), I'm not particularly 'code-friendly' although I know my way around the site structure files. On the line, the code you mentioned is in line 10, the error was throwing to line 11. By changing line 10 to contain the given code, should this stop the error?
In terms of the phpinfo(), I'm not particularly 'code-friendly' although I know my way around the site structure files. On the line, the code you mentioned is in line 10, the error was throwing to line 11. By changing line 10 to contain the given code, should this stop the error?
The errors should still be logged they just won't be displayed. Displaying errors is just for debugging and can cause problems with live stores. You also need to switch off in system/config/default.php.
You need a .php file with the following in your hosting directory. Then go to that file in an web browser. Remember to delete the file afterwards.
Yes, changing line 10 will stop the error, because line 11 will be skipped if the variable it needs isn't there.
You need a .php file with the following in your hosting directory. Then go to that file in an web browser. Remember to delete the file afterwards.
Code: Select all
<?php
phpinfo();
?>
Now that the issue has been solved, please add: [SOLVED] at the beginning of the subject line on your first post.SecurityHardware1 wrote: ↑Fri Aug 06, 2021 8:54 pmThanks for your help, this seems to have been resolved with the site now.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Who is online
Users browsing this forum: Bing [Bot] and 234 guests