When I upgrade from version 2.4.0 to 2.5.1 I receive an error on the admin payment methods page.
The exception:
1 exception(s):
Exception #0 (Exception): Warning: Invalid argument supplied for foreach() in /var/www/html/vendor/paynl/magento2-plugin/Model/Config/Source/PinTerminals.php on line 86
When I upgrade from version 2.4.0 to 2.5.1 I receive an error on the admin payment methods page.
The exception:
These lines of code appear to be the issue.
When I dump
$terminals = \Paynl\Instore::getAllTerminals();
I get.object(Paynl\Result\Instore\Terminals)#3312 (1) { ["data":protected]=> array(2) { ["request"]=> array(3) { ["result"]=> string(1) "1" ["errorId"]=> string(0) "" ["errorMessage"]=> string(0) "" } ["terminals"]=> string(0) "" } }
When I dump
$terminals = $terminals->getList();
I get an empty string.I think that either the
->getList()
function should return an empty array in this case or there should be a check that$terminals
is iterable.