[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»

php7
bug
bug-fix
php72
php72-count

(Dmitry Fedyuk) #1

It is similar to:


[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»
How to adapt Magento 2 to PHP 7.2?
(Dmitry Fedyuk) #2

My fix

Replace the line:

with the following one:

<?php if ($block->getTotals()): ?>