v1.1.0: Fix the issue cannot save catalog rule on M2.3.4

Created by Support Agent, Modified on Wed, 22 Apr at 12:22 AM by Support Agent

Issue:

We have used module version 1.1.0 on M2.3.4 CE. When testing on the backend, we cannot save the  catalog rule and got this error:

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`stgdb`.`catalogrule_website`, CONSTRAINT `CATALOGRULE_WEBSITE_ROW_ID_CATALOGRULE_ROW_ID` FOREIGN KEY (`row_id`) REFERENCES `catalogrule` (`row_id`) ON DELETE CASCADE), query was: INSERT  INTO `catalogrule_website` (`website_id`,`row_id`) VALUES (?, ?) ON DUPLICATE KEY UPDATE `row_id` = VALUES(`row_id`)

Please check and give us the solution.


Solution: 

First, we would like to confirm that when your Magento version is M2.3.4, please use our module version 1.0.9 since this version works well on M2.3.4 at this time.

In case you still want to use version 1.1.0 on M2.3.4, we would like to give the hot-fix solution as below.

+ Add this file 

app/code/Bss/CatalogRulePerStoreView/view/adminhtml/ui_component/catalogrulestaging_update_form.xml

+ Apply the new code on the site and flush the cache.


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

We're more than happy to support you.


About us


BSS Commerce is a full-service ecommerce agency with 14+ years of experience, supporting 75,000+ customers worldwide. As an Adobe Commerce Solution Bronze Partner and Select Magento Extensions Builder, we deliver trusted end-to-end solutions.


Our core strength is Magento, with 150+ extensions designed to enhance store performance and drive growth. With deep expertise from years of working on Magento websites, we deliver scalable, high-impact solutions backed by strong client trust.


Discover our extensions: https://bsscommerce.com/magento-2-extensions.html 


If you want to find the best solution for your website, here are our top tier plugins:

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