Post by DesignCart » Wed Oct 24, 2018 12:00 am

Hi
After migrate shop from XAMPP on serwer I see php warning:

Code: Select all

Warning: count(): Parameter must be an array or an object that implements Countable in .../system/library/template/Twig/Extension/Core.php on line 1266
I checked all folder cache and deleted all files. I cleaned cache in panel admin. I refresh modyfication in panel admin and nothing helped.

Somebody have any idea? :(

my website: Tworzenie sklepu internetowego


User avatar
Active Member

Posts

Joined
Thu Nov 10, 2016 2:06 pm
Location - Gubin

Post by IP_CAM » Wed Oct 24, 2018 7:40 am

Countable PHP 7.2x Problem
You seem to run a PHP v.7.2x Environment, so, switch back to a lower PHP 7.x Version,
or then, get this Line #1266 fixed by a Coder:

Code: Select all

return is_scalar($thing) ? mb_strlen($thing, $env->getCharset()) : count($thing);
This might have a similar meaning, as mentioned in the posting linked below, as I assume, it should
first check for 'whatever valid', then count the 'pieces', not in reverse ... :D (but I am not a Coder...)
viewtopic.php?f=19&t=207673&p=737973#p737973
viewtopic.php?f=179&t=205523&p=728536#p728589

Just an idea, good Luck! ;)
Ernie

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by DesignCart » Wed Oct 24, 2018 3:37 pm

@IP_CAM thank You for answer and help. Your idea work fine and fix my problem.
I changed php version to 5.6 from 7.2

my website: Tworzenie sklepu internetowego


User avatar
Active Member

Posts

Joined
Thu Nov 10, 2016 2:06 pm
Location - Gubin

Post by assyk » Thu Aug 08, 2019 5:35 am

Gratz of IP_Cam and changing at row #1266:

Code: Select all

return is_scalar($thing) ? mb_strlen($thing, $env->getCharset()) : count($thing);
with

Code: Select all

return is_scalar($thing) ? mb_strlen($thing, $env->getCharset()) : ($thing instanceof Countable ? count($thing):0);
my error message disapeared

Newbie

Posts

Joined
Thu Aug 02, 2018 6:30 pm

Post by kuochinwu » Mon Aug 29, 2022 4:19 am

assyk wrote:
Thu Aug 08, 2019 5:35 am
Gratz of IP_Cam and changing at row #1266:

Code: Select all

return is_scalar($thing) ? mb_strlen($thing, $env->getCharset()) : count($thing);
with

Code: Select all

return is_scalar($thing) ? mb_strlen($thing, $env->getCharset()) : ($thing instanceof Countable ? count($thing):0);
my error message disapeared
Hello, I applied the code and it worked and no more error in logs; however, the language and currency drop-down selections on the top header got disappeared after this patch. any other help?

Newbie

Posts

Joined
Fri Oct 28, 2016 12:48 am

Post by straightlight » Mon Aug 29, 2022 6:36 am

kuochinwu wrote:
Mon Aug 29, 2022 4:19 am
assyk wrote:
Thu Aug 08, 2019 5:35 am
Gratz of IP_Cam and changing at row #1266:

Code: Select all

return is_scalar($thing) ? mb_strlen($thing, $env->getCharset()) : count($thing);
with

Code: Select all

return is_scalar($thing) ? mb_strlen($thing, $env->getCharset()) : ($thing instanceof Countable ? count($thing):0);
my error message disapeared
Hello, I applied the code and it worked and no more error in logs; however, the language and currency drop-down selections on the top header got disappeared after this patch. any other help?
Recently, the currency selection issue has been fixed in the opencart-3 repository. See if you are now able to select currencies and notice the changes with the amounts accordingly: https://www.github.com/opencart/opencart-3 .

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: Bing [Bot], nonnedelectari and 401 guests