[Issue] Ensure that previously existing records in catalog_url_rewrite_produc… #34210
Closed
2 of 5 tasks
Labels
Area: Import / export
Component: CatalogUrlRewrite
Issue: Confirmed
Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed
Issue: ready for confirmation
Priority: P2
A defect with this priority could have functionality issues which are not to expectations.
Progress: done
Reproduced on 2.4.x
The issue has been reproduced on latest 2.4-develop branch
Severity: S2
Major restrictions or short-term circumventions are required until a fix is available.
This issue is automatically created based on existing pull request: #34209: Ensure that previously existing records in catalog_url_rewrite_produc…
Ensure that previously existing records in catalog_url_rewrite_product_category are deleted before trying to insert them again.
Description (*)
Changes
Delete existing records in the catalog_url_rewrite_product_category table before inserting the same ones.
Why
This change will avoid the following exception during multi store product import :
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '74583' for key 'PRIMARY', query was: INSERT INTO
catalog_url_rewrite_product_category
(url_rewrite_id
,category_id
,product_id
) VALUES (?, ?, ?), ...The problem is that catalog_url_rewrite_product_category records are not created storewise for a given request_path. On the other side, url_rewrite records are created storewise.
If, during the same import, a product and its url_rewrite records are created for stores A and B in the first batch and then for store C in a second batch and if product url keys and category name are the same for all those stores, an insert try for duplicated catalog_url_rewrite_product_category records will cause the mentioned issue.
Related Pull Requests
None
Fixed Issues (if relevant)
Not relevant
Manual testing scenarios (*)
che
website withde_ch
,en_ch
,es_ch
,fr_ch
,zh_ch
store viewsexp
website withde_ex
,en_ex
,es_ex
,fr_ex
,zh_ex
store viewsProducts
categoryQuestions or comments
I am not sure if an additional test is needed for that. Please, tell me if it is the case.
Contribution checklist (*)
The text was updated successfully, but these errors were encountered: