2

I have many issues in the error log file that I don't understand. I didn't found any info on this specific issue anywhere.

There is the error :

[:error] [pid 23390] [client 78.235.181.108:52380] PHP Fatal error: Uncaught Error: Call to a member function getFinalProduct() on null in /data/www/mystore/prod/vendor/magento/module-wishlist/CustomerData/Wishlist.php:135\nStack trace:\n#0 /data/www/mystore/prod/vendor/magento/module-wishlist/CustomerData/Wishlist.php(120): Magento\Wishlist\CustomerData\Wishlist->getItemData(Object(Magento\Wishlist\Model\Item))\n#1 /data/www/mystore/prod/vendor/magento/module-wishlist/CustomerData/Wishlist.php(77): Magento\Wishlist\CustomerData\Wishlist->getItems()\n#2 /data/www/mystore/prod/vendor/magento/module-customer/CustomerData/SectionPool.php(79): Magento\Wishlist\CustomerData\Wishlist->getSectionData()\n#3 /data/www/mystore/prod/vendor/magento/module-customer/CustomerData/SectionPool.php(60): Magento\Customer\CustomerData\SectionPool->getSectionDataByNames(Array)\n#4 /data/www/mystore/prod/vendor/magento/module-customer/Controller/Section/Load.php(77): Magento\Customer\CustomerData\SectionPool->getSectionsData(Array, false)\n#5 /data/ww in /data/www/mystore/prod/vendor/magento/module-wishlist/CustomerData/Wishlist.php on line 135

, referer:

The wishlist feature is the basic one from Magento (no extension should overwrite that on our website).

Do you have any idea about this problem ?

0

In the file vendor/magento/module-wishlist/CustomerData/Wishlist.php at line no 135

Need to change inside the method

protected function getItemData(\Magento\Wishlist\Model\Item $wishlistItem)

Change 
'image' => $this->getImageData($this->itemResolver->getFinalProduct($wishlistItem)),
To
'image' => $this->getImageData($product),
  • Sorry, I did not see your answer. But no luck, I already have 'image' => $this->getImageData($product), in my file – Aubin Jun 27 at 9:52
0

Check if you have any rewrites for class \Magento\Wishlist\CustomerData\Wishlist and fix conflicts. Looks like base class constructor never runs so $this->itemResolver variable is null.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.