Description
Preconditions
- Magento 2.4-develop
Steps to reproduce
-
Save and duplicate product A, creating a duplicate product B
-
Edit product B, change the URL Key under "Search Engine Optimization" while leaving "Create Permanent Redirect for old URL" checked and save the product
-
Open product A
-
Save and duplicate product A again in an attempt to create product C
Expected result
- A workflow that lets me duplicate the product by e.g. changing the URL Key.
Actual result
- Warning
The value specified in the URL Key field would generate a URL that already exists.
- Products don't have url key
product-a-1
but product A cannot be duplicated again
Original descirption
Preconditions
- Environment
- php7.0 7.0.25-1+ubuntu16.04.1+deb.sury.org+1
- mysql-server-5.7 5.7.20-0ubuntu0.16.04.1
- magento 2.2.1 with (some) data imported from m1.6.2 (with earlier m2 version)
- Some categories of which some are imported from m1.6.2 (with earlier m2 version)
- URLRewrites for these products and categories
Steps to reproduce
- Open an old product, click on "Save and duplicate"
Expected result
- A workflow that lets me duplicate the product by e.g. changing the URL Key.
Actual result
I see a warning
The value specified in the URL Key field would generate a URL that already exists.
To resolve this conflict, you can either change the value of the URL Key field (located in the Search Engine Optimization section) to a unique value, or change the Request Path fields in all locations listed below:
- PRODURLKEY.html
- CATURLKEY/SUBCATURLKEY/PRODURLKEY.html
[... modified for readability ...]
You saved the product.
The product is then not duplicated.
I assume the error/warning message changed in Magento 2.2.1 (might have been "URL key for specified store already exists." before). There is a variety of other issues, none of which addresses the implications of this usecase (extremely inconvient product duplication workflow).
Also, the solution proposed by the warning (changing the URL Key and hitting "Save and duplicate") does not work.
I think it might have something to do with the attributes (url_key
, url_path
) being assigned to different stores (store_id
).
I understand that developers favor NOT to use magento1-stlye and just append something to the url_key to prevent duplicates to avoid what some user called a SEO-mess. However, it should be easy to duplicate a given product (and e.g. manually assign a new url-key).
I will update this issue with a list of related issues as they cross my way.