Fatal error if product building fails or cache as invalid product
Closed this issue · 0 comments
fairlane commented
Magento 2 version(s) used: 4.0.6
Extension version(s) affected: 2.3.4
Description
We get fatal error if cache entry / product building fails.
Uncaught exception 'Error' with message 'Call to a member function getProductData() on null' in vendor/nosto/module-nostotagging/Model/Service/Product/CachingProductService.php:104
How to reproduce
Find a product where the product building fails visit product page
Magento 2 mode
- Developer
- Production
Full page cache
- Enabled
- Disabled
Nosto indexer mode
- Update On Save
- Update By Schedule
Possible Solution
Check the type of $cachedProduct
(https://github.com/Nosto/nosto-magento2/blob/develop/Model/Service/Product/CachingProductService.php#L103) before processing further.