Jump to content

Webservice count(): Parameter must be an array or an object that implements Countable


johnymas

Recommended Posts

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

  • 8 months later...
  • 11 months later...
  • 5 months later...

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 

Screenshot (29).png

Link to comment
Share on other sites

  • 1 month later...
  • 3 months later...
  • 5 months later...
  • 4 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...