Post by gsc1ugs » Sat Nov 02, 2024 12:52 am

I'm on version 3.0.3.8 and get this error i dont ant to upgrade opencart

2024-11-01 16:49:06 - PHP Unknown: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /home/garyjacobjack/public_html/admin/controller/extension/dashboard/map.php on line 102
Last edited by gsc1ugs on Wed Nov 06, 2024 9:48 pm, edited 1 time in total.

Active Member

Posts

Joined
Mon Sep 09, 2013 3:32 pm

Post by softmonke » Sat Nov 02, 2024 2:27 am

Well, this error is quite self-explanatory. If you take a look at line 102 of "admin/controller/extension/dashboard/map.php", you will see the following line:

Code: Select all

$json[strtolower($result['iso_code_2'])] = array(
Since the error already says the passing a null value to the strtolower function is deprecated, that means "$result['iso_code_2']" is potentially null. I guess there are a few possibilities to resolve this here:

1. The iso_code_2 field is empty for one or more countries. You can probably run a quick SQL query to check if any countries are missing the iso_code_2 field.
2. One or more orders in your OpenCart website is missing the payment_country_id column or does not match with a country_id in the country table.
3. If you don't care about the accuracy of your orders across the world map, you can just do a check if $result['iso_code_2'] is null or not, and if it is, skip that loop.

Check out our ever-growing list of extensions for OpenCart here.
Some useful extensions for a better admin experience: Image File Manager ProDrag & Drop Sort Order

Reach out to us at hello@softmonke.com for your OpenCart web development needs or feedback for our extensions.


User avatar
Active Member

Posts

Joined
Tue May 23, 2023 4:42 am


Post by JNeuhoff » Sat Nov 02, 2024 3:37 am

OC 3.0.3.8 doesn't support PHP 8.x versions, for the latter you should use OC 3.0.4.0.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by OSWorX » Sat Nov 02, 2024 5:14 pm

Unfortunately it's nowhere stated which php-Version should be used when using OpenCart Version x !
It's basically the same situation can be seen at the documentation(s).

To summarize it quickly:

1. Up to OpenCart Version 3.0.9.0 DO NOT USE php 8.x
2. When using php 8.x use the version 3.0.4.0 (fully compatible up to 8.3.x) > https://github.com/opencart/opencart/re ... ag/3.0.4.0
3. As of today, 4.x is compatible with php 8.x - but not useable because of too many bugs (wait until 4.1.0.0 is published .. whenever that happens ..)
4. DO NOT UPDATE your current 3.x version - better install a 2nd instance (with 3.0.4.0) and when than all works 100% > switch
5. If you are using still 2.x (which btw. is still very good), you can use this php 8.x compatible package: https://github.com/condor2/Opencart_23xx
6. You are using OpenCart 1.5. .. bad .. because of several reasons, mainly >>

7. These days only php 8.x (8.2.x or 8.3.x) should be used - reasons (just to mention a few):
7.1 faster
7.2 better security
7.3 support
7.4 all prior versions are out of service and get no more updates .. very bad: no more security fixes, see: https://php.watch/versions

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by OSWorX » Sat Nov 02, 2024 5:17 pm

gsc1ugs wrote:
Sat Nov 02, 2024 12:52 am
I'm on version 3.0.3.8 and get this error i dont ant to upgrade opencart
As written here: posting.php?mode=quote&p=874533#pr874544

You don't want to update, but in your situation you should!

Finally what do you want: a webshop for you .. or your customers?
If for your customers, update to OpenCart 3.0.4.0 and use php 8.3.x.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by gsc1ugs » Sat Nov 02, 2024 7:24 pm

Thanks for replies but orders still coming in so not broken so i'll just fix for my needs using php 8.1 for version 3.0.3.8

Active Member

Posts

Joined
Mon Sep 09, 2013 3:32 pm

Post by gsc1ugs » Wed Nov 06, 2024 9:48 pm

Fixed with this

Code: Select all

$tmpstr = $result['iso_code_2'];
if(!empty($tmpstr))
{
	$json[strtolower($result['iso_code_2'])] = array(
		'total'  => $result['total'],
		'amount' => $this->currency->format($result['amount'], $this->config->get('config_currency'))
	);
}

Active Member

Posts

Joined
Mon Sep 09, 2013 3:32 pm

Post by OSWorX » Wed Nov 06, 2024 10:25 pm

Has nothing to do with the used php version.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria
Who is online

Users browsing this forum: No registered users and 5 guests