magento2: Error when saving product in catalog/products

Preconditions (*)

  1. Mysql 8.0.21
  2. Php 7.3.19

Steps to reproduce (*)

  1. In backend, catalog/products
  2. Click to save

Expected result (*)

  1. Product saved without error

Actual result (*)

  1. SQLSTATE[23000]: Integrity constraint violation: 1052 Column ‘store_id’ in where clause is ambiguous, query was: SELECT main_table.* FROM url_rewrite AS main_table INNER JOIN catalog_product_entity AS product_entity ON main_table.entity_id = product_entity.entity_id INNER JOIN catalog_product_entity_int AS product_status_default ON product_status_default.entity_id = product_entity.entity_id AND product_status_default.attribute_id = 97 AND product_status_default.store_id = 0 LEFT JOIN catalog_product_entity_int AS product_status ON product_status.entity_id = product_entity.entity_id AND product_status.attribute_id = 97 AND product_status.store_id = main_table.store_id WHERE (redirect_type = ‘0’) AND (entity_type = ‘product’) AND (store_id IN(‘1’, 0)) AND ((product_status.value_id > 0 AND product_status.value IN (1)) OR (product_status.value_id IS NULL AND product_status_default.value IN (1))) AND (product_entity.entity_id = ‘88514’)

Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • [*] Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 17 (1 by maintainers)

Most upvoted comments

I confirm that issue is linked with amasty/module-fpc-warmer. If you disable the option “Auto-update Cache upon the Product Changes” everything seems to work again without any change in UrlRewriteCollection.php

I reported issue to Amasty support

Hello all.

In my side issue was related with mirasvit seo extension.

I can solve it with changement in:

/var/www/html/vendor/magento/module-url-rewrite/Model/ResourceModel/UrlRewriteCollection.php : $this->addFieldToFilter (‘main_table.store_id’, [‘in’ => $store]);

If you need i can send détails of file change.