-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Labels
Area: ProductComponent: CatalogFixed in 2.4.xThe issue has been fixed in 2.4-develop branchThe issue has been fixed in 2.4-develop branchIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.A defect with this priority could have functionality issues which are not to expectations.Progress: doneReported on 2.4.3-p1Indicates original Magento version for the Issue report.Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchThe issue has been reproduced on latest 2.4-develop branch
Description
I'm not able to add any products from admin. My Magento is in single store mode with website id = 2.
Saving a new product fails with Integrity constraint violation.
Editing and saving an existing product works fine. I am also able to create new products using the import feature.
The issue was reproduced on a clean Magento instance.
Preconditions (*)
- Magento Open Source 2.4.3-p1
- php 7.4
- MariaDB 10.4
Steps to reproduce (*)
- Install a clean version of Magento version 2.4.3-p1
- Add a new website, store and store view, and make this the default
-
In Stores -> All Stores:
- Create new website (
new_website
) - Create new store (
new_store
) under new_website - Create new store view (
new_store_view
) under new_store
- Create new website (
-
Open
new_website
again, and set this as default. Save.
-
Delete the preinstalled website (
base
) -
Verify your website db entries. The default website should be 2:
SELECT * FROM store_website; +------------+-------------+-------------+------------+------------------+------------+ | website_id | code | name | sort_order | default_group_id | is_default | +------------+-------------+-------------+------------+------------------+------------+ | 0 | admin | Admin | 0 | 0 | 0 | | 2 | new_website | New Website | 0 | 2 | 1 | +------------+-------------+-------------+------------+------------------+------------+
-
In Stores -> Configuration -> General -> SIngle-Store Mode
- Enable Single-store Mode. Save.
-
Verify your Single-store configuration:
bin/magento config:show general/single_store_mode/enabled
Should return 1
-
In Catalog -> Products
- Add Product
- Populate name, sku and price. Save.
Expected result (*)
- The product should save successfully
Actual result (*)
- The save action fails, with the following message:
`SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`denuhabsxr`.`catalog_product_website`, CONSTRAINT `CATALOG_PRODUCT_WEBSITE_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID` FOREIGN KEY (`website_id`) REFERENCES `store_website` (`website_id`) ON DELETE ), query was: INSERT INTO `catalog_product_website` (`product_id`,`website_id`) VALUES (?, ?)`
monteshot, mozok, quterorta, KrasnoshchokBohdan, OleksandrZheleznyi and 2 more
Metadata
Metadata
Assignees
Labels
Area: ProductComponent: CatalogFixed in 2.4.xThe issue has been fixed in 2.4-develop branchThe issue has been fixed in 2.4-develop branchIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.A defect with this priority could have functionality issues which are not to expectations.Progress: doneReported on 2.4.3-p1Indicates original Magento version for the Issue report.Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchThe issue has been reproduced on latest 2.4-develop branch
Type
Projects
Status
Done