[PHP 7.2] My fix for «Warning: count(): Parameter must be an array or an object that implements Countable in Magento/Wishlist/Observer/AddToCart.php on line 79»

php7
bug
bug-fix
php72
php72-count
(Dmitry Fedyuk) #1

It is similar to:

0 Likes

[PHP 7.2] My fix for «Warning: count(): Parameter must be an array or an object that implements Countable in lib/internal/Magento/Framework/View/Design/Theme/ThemeList.php on line 237»
[PHP 7.2] My fix for «Warning: sizeof(): Parameter must be an array or an object that implements Countable in app/code/Magento/Sales/view/adminhtml/templates/order/totalbar.phtml on line 10»
How to adapt Magento 2 to PHP 7.2?
(Dmitry Fedyuk) #2

My fix

Replace the line:

with the following one:

if ($wishlistIds && count($wishlistIds) && $request->getParam('wishlist_next')) {
0 Likes

(Igor Kogan) #3

Thank you very match for good fix!

0 Likes