cancel
Showing results for 
Search instead for 
Did you mean: 

Issue after upgrade to 2.3.4

SOLVED
   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

Issue after upgrade to 2.3.4

Hi,

I made an upgrade from v2.3.3 to v2.3.4 and now when i try to edit a product i receive this error:

 

Warning: Invalid argument supplied for foreach() in /vendor/magento/module-catalog/Model/ProductLink/CollectionProvider.php on line 185

 

Any idea where this error might be?

 

BR

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Issue after upgrade to 2.3.4

 

in exception.log i found this error

temando.CRITICAL: "accountId" is required. Enter and try again. {"exception":"[object] (Magento\Framework\Exception\InputException(code: 0): \"accountId\" is required. Enter and try again. at /public_html/vendor/magento/framework/Exception/InputException.php:91)"}

after i search on goole i found this solution https://magenaut.com/fix-error-after-disable-temando_shipping/

View solution in original post

2 REPLIES 2

Re: Issue after upgrade to 2.3.4

 

in exception.log i found this error

temando.CRITICAL: "accountId" is required. Enter and try again. {"exception":"[object] (Magento\Framework\Exception\InputException(code: 0): \"accountId\" is required. Enter and try again. at /public_html/vendor/magento/framework/Exception/InputException.php:91)"}

after i search on goole i found this solution https://magenaut.com/fix-error-after-disable-temando_shipping/

Re: Issue after upgrade to 2.3.4

The Temando extension disabled can't fix the same problem for me. I found this variable $this->mapProviders is empty in /vendor/magento/module-catalog/Model/ProductLink/CollectionProvider.php file. This caused the problem. not sure what happened. I solved this problem by modifying the core magento file in /vendor/magento/module-catalog/Model/ProductLink/CollectionProvider.php. In getMap function, add this after if (!$types) {...}. So it'd be:

...
public function getMap(array $products, array $types): array
{
    if (!$types) {
        throw new \InvalidArgumentException('Types are required');
    }
   //FIX Warning: Invalid argument supplied for foreach() in /vendor/magento/module-catalog/Model/ProductLink/CollectionProvider.php on line 185
    if (!(is_array($this->mapProviders))) {
        $this->mapProviders = array(
            ObjectManager::getInstance()->create(LinkedMapProvider::class)
        );
    }
   ...
}
...


You need to import a few files as well on the top of this file:

use Magento\Catalog\Model\ProductLink\CollectionProvider\LinkedMapProvider;
use Magento\Framework\App\ObjectManager;


I know this fix is not clean as magento way. let me know if there is a better fix.