Post by sanshay » Sat May 12, 2018 12:38 am

Hello
I have updated my server from php 5.6 to 7.2
Now i get error

Code: Select all

PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /xxxxx/xxxxx/xxxxx/xxxxx/public_html/catalog/model/tool/path_manager.php on line 49
When i view the code:

Code: Select all

if (count($banned_cats) && (count($categories) > 1)) {
        if (in_array($path[$key], $banned_cats)) {
						unset($path[$key]);
				} else if (preg_match('#[_=](\d+)$#', $path[$key], $cat)) {
					if (in_array($cat[1], $banned_cats)) {
						unset($path[$key]);
          }
I have the same error on my 3 stores
Any one have Idea

Regards

Active Member

Posts

Joined
Fri Jan 25, 2013 8:49 pm

Post by Johnathan » Sat May 12, 2018 1:21 am

I don't believe /catalog/model/tool/path_manager.php is a built-in OpenCart file, so this is probably due to a mod you've installed. Try finding the developer of it (perhaps by opening up the file) and contact them to help get it fixed.

Image
Image Image Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by IP_CAM » Sat May 12, 2018 7:59 am

Well, this PHP 7.2.x related Problem seems to be very common in many
software installations, not only in Opencart, as I found out. So, I switched
back to PHP 7.1.xx again, and it was gone. Just to mention it.
Ernie
https://wiki.php.net/rfc/counting_non_countables

For Sale: Top URL's, including an OpenCart V-Pro Shop!
A wide range of matching Designs can be seen here: http://www.opencart.li
For Information on URL's offered, please contact me at: jti@jacob.ch
Hundreds of Mods in 380+ Repositories for OC v.1.5.x - v.2.3.x
to be found on my Github Site: https://github.com/IP-CAM
Image


User avatar
Guru Member

Posts

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

Post by sanshay » Sun May 13, 2018 1:40 am

Hello
It was indeed from a module. That has been fixed.
A lot of modules are updated now.
Still a few errors, but finding out where they come from.
Regards

Active Member

Posts

Joined
Fri Jan 25, 2013 8:49 pm

Post by sanshay » Sun May 13, 2018 1:45 am

IP_CAM wrote:
Sat May 12, 2018 7:59 am
Well, this PHP 7.2.x related Problem seems to be very common in many
software installations, not only in Opencart, as I found out. So, I switched
back to PHP 7.1.xx again, and it was gone. Just to mention it.
Ernie
https://wiki.php.net/rfc/counting_non_countables
Indeed, i have updated all my clients website, like wordpress,, other cms software.
Now updating one by one the opencart stores ( 4 running on 2.3.0.2) 1 is in building mode 3.0.2 where i het a lot off errors but was on php 5.6
So i hope its gone with the new php 7.2.5

Keep this post updated ;-)

Active Member

Posts

Joined
Fri Jan 25, 2013 8:49 pm

Post by sanshay » Tue May 15, 2018 8:25 pm

More info founded:
Here you can see where you should take into account the upgrade to PHP 7.2: https://secure.php.net/manual/en/migration72.php

Specifically this section seems to refer to the count function:
https://secure.php.net/manual/en/migrat ... atible.php (part "Warn when counting non-countable types")

That indicates that a count is executed on a type that would always have the same value because there is nothing to count within that data type.
This will give the same result in previous PHP versions only now there is a warning given that here is an expected error in the code.

Active Member

Posts

Joined
Fri Jan 25, 2013 8:49 pm
Who is online

Users browsing this forum: No registered users and 5 guests