Post by tlegends » Thu Feb 02, 2023 3:14 am

Opencart 3.02
Just upgraded PHP to 7.4
I read that a change to PHP 7.4 is Trying to use values of type null, bool, int, float or resource as an array (such as $null["key"]) will now generate a notice.
Now getting this error
PHP Notice: Trying to access array offset on value of type bool in /storage/modification/catalog/controller/startup/startup.php on line 199
This is lines 198 - 202
if (isset($this->session->data['payment_address'])) {
$this->tax->setPaymentAddress($this->session->data['payment_address']['country_id'], $this->session->data['payment_address']['zone_id']);
} elseif ($this->config->get('config_tax_default') == 'payment') {
$this->tax->setPaymentAddress($this->config->get('config_country_id'), $this->config->get('config_zone_id'));
}

What is the best way to solve this and other null values
Is it better to upgrade to PHP 8 or will there be more issues

New member

Posts

Joined
Thu Apr 14, 2016 10:45 am

Post by xxvirusxx » Thu Feb 02, 2023 3:22 am

If you don't have custom modification in code you can upgrade to 3.0.3.8 Maintenance branch
https://github.com/opencart/opencart/tr ... aintenance

If you don't upgrade, here is the fix
https://github.com/opencart/opencart/bl ... p.php#L187

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by paulfeakins » Thu Feb 02, 2023 11:31 pm

tlegends wrote:
Thu Feb 02, 2023 3:14 am
Opencart 3.02
Please, OpenCart version numbers are not complex, at least get that bit right.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by tlegends » Sun Feb 05, 2023 2:06 am

xxvirusxx
Thank You

New member

Posts

Joined
Thu Apr 14, 2016 10:45 am
Who is online

Users browsing this forum: No registered users and 269 guests