I am getting this weird one When an shipping is created then navigating to Shippings
I the Action column when click view I get the error:
1 exception(s): Exception #0 (Exception): Warning: Invalid argument supplied for foreach() in ../../../../htdocs/vendor/magento/module-shipping/view/adminhtml/templates/order/packaging/packed.phtml on line 12
I looked at the packed.html and this is the line
<?php foreach ($block->getPackages() as $packageId => $package): ?>
I debug by:
print_r(gettype($block->getPackages())); RETURNS string
print_r($block->getPackages()); RETURNS []
I am really confused I got dev environment which works fine and they return:
print_r(gettype($block->getPackages())); RETURNS array
print_r($block->getPackages()); RETURNS Array()
There is definitely a difference there but what caused this not sure
Looking at teh:
Magento\Shipping\Block\Adminhtml\Order\Packaging
public function getPackages()
{
return $this->getShipment()->getPackages();
}
PhpStorn inspection definitely complaint about return string when should return array Anyone have any idea is this a bug?