johnymas Posted October 21, 2018 Share Posted October 21, 2018 Due to this warning below webservice will not work at all [PHP Warning #2] count(): Parameter must be an array or an object that implements Countable (/var/www/clients/client17/web51/web/classes/webservice/WebserviceRequest.php, line 800) So we have to change line 800 from if (count(self::$shopIDs)) { to if (self::$shopIDs && count(self::$shopIDs)) { We use the latest version of prestashop 1.7.4.3 which have to be compatible with php 7.2. ?? Link to comment Share on other sites More sharing options...
caovillanueva Posted July 2, 2019 Share Posted July 2, 2019 i had the same problem, .Was fixed changing the PHP version to 7.0 Link to comment Share on other sites More sharing options...
norman_12 Posted June 16, 2020 Share Posted June 16, 2020 @caovillanueva i having the same problem, and i'm newbie can you please tell how you changed the PHP version to 7.0 Link to comment Share on other sites More sharing options...
onemynig Posted December 9, 2020 Share Posted December 9, 2020 When I install the new prestashop 1.7.7 and it upgraded me to PHP 7.2 and I'm getting this error on the web page (picture) this is the code on the php page public function hookdisplayNav2($param) { $id_shop = (int)Context::getContext()->shop->id; $staticBlocks = $this->_staticModel->getStaticblockLists($id_shop,'displayNav2'); if(count($staticBlocks)<1) return null; $this->smarty->assign(array( 'staticblocks' => $staticBlocks, )); return $this->display(__FILE__, 'views/templates/block.tpl'); } Im not getting any syntax error any help on fixing this thanks Link to comment Share on other sites More sharing options...
victor40 Posted December 10, 2020 Share Posted December 10, 2020 change php version 7.1 Link to comment Share on other sites More sharing options...
JBW Posted December 11, 2020 Share Posted December 11, 2020 The module "labertacticblocks" seems not to be compatible with PHP 7.2. - you should ask the developer to fix it or deactivate it Link to comment Share on other sites More sharing options...
fredecs Posted January 11, 2021 Share Posted January 11, 2021 Change if (count(self::$shopIDs)) { to if (@count(self::$shopIDs)) { (just put @ before count). This will validate the expression before count acctually counts the content. Link to comment Share on other sites More sharing options...
jungwirbtgut Posted April 27, 2021 Share Posted April 27, 2021 On 1/11/2021 at 6:19 PM, fredecs said: Change if (count(self::$shopIDs)) { to if (@count(self::$shopIDs)) { (just put @ before count). This will validate the expression before count acctually counts the content. Which file? Link to comment Share on other sites More sharing options...
fredecs Posted April 27, 2021 Share Posted April 27, 2021 classes/webservice/WebserviceRequest.php 1 Link to comment Share on other sites More sharing options...
infomoreira Posted October 1, 2021 Share Posted October 1, 2021 On 4/27/2021 at 5:07 PM, fredecs said: classes/webservice/WebserviceRequest.php Thank you! This is the solution. 1 Link to comment Share on other sites More sharing options...
nawres Posted February 3, 2022 Share Posted February 3, 2022 maybe same error , but solution not working with my case Link to comment Share on other sites More sharing options...
JBW Posted February 3, 2022 Share Posted February 3, 2022 Seems to be caused by a mpodule "CustomFields" that is not compatible with your PHP version Link to comment Share on other sites More sharing options...
nawres Posted February 3, 2022 Share Posted February 3, 2022 Ok I will try thank you Link to comment Share on other sites More sharing options...
caovillanueva Posted February 4, 2022 Share Posted February 4, 2022 On 6/16/2020 at 5:08 AM, norman_12 said: @caovillanueva i having the same problem, and i'm newbie can you please tell how you changed the PHP version to 7.0 Depends what program you are using to run websites (XAMP, LARAGON, EASYPHP). Check the preferences to switch the PHP ver. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now