v2.2.4: Fix Fatal error (line 142) when saving a product on M2.3.5 CE

Created by Rosa Truong, Modified on Thu, 21 May, 2020 at 3:02 PM by Rosa Truong

Issue:


I am using module Magento 2 Multiple Store View Pricing v2.2.4 on m2.3.5 CE.

When saving a price for a product in a single store view I get the following error:


Fatal error: Uncaught Error: Call to a member function getEntityId() on integer in /data/web/magento2/app/code/Bss/MultiStoreViewPricingCatalogRule/Model/Indexer/RuleProductsSelectBuilder.php:142 Stack trace: #0 /data/web/magento2/app/code/Bss/MultiStoreViewPricingCatalogRule/Model/Indexer/ReindexRuleProductPrice.php(117): Bss\MultiStoreViewPricingCatalogRule\Model\Indexer\RuleProductsSelectBuilder->build(1, 1, false, '1') #1 /data/web/magento2/vendor/magento/module-catalog-rule/Model/Indexer/IndexBuilder.php(484): Bss\MultiStoreViewPricingCatalogRule\Model\Indexer\ReindexRuleProductPrice->execute(1000, 1) #2 /data/web/magento2/vendor/magento/module-catalog-rule/Model/Indexer/IndexBuilder.php(251): Magento\CatalogRule\Model\Indexer\IndexBuilder->applyRules(Object(Magento\CatalogRule\Model\ResourceModel\Rule\Collection), Object(Magento\Catalog\Model\Product\Interceptor)) #3 /data/web/magento2/vendor/magento/module-catalog-rule/Model/Indexer/Product/ProductRuleIndexer.php(26): Magento\CatalogRule\Model\Indexer\IndexBuilder- in /data/web/magento2/app/code/Bss/MultiStoreViewPricingCatalogRule/Model/Indexer/RuleProductsSelectBuilder.php on line 142


Solution:


This issue is caused due to our module's bug on Magento 2.3.5.

To fix this issue, please edit this file and replace it on your site.

app/code/Bss/MultiStoreViewPricingCatalogRule/Model/Indexer/RuleProductsSelectBuilder.php


If you need any assistance, please feel free to contact us.




Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article