Skip to content

Product duplication of imported products "fails" due to url rewrites #12412

Open
@fwolfst

Description

@fwolfst

Preconditions

  1. Magento 2.4-develop

Steps to reproduce

  1. Save and duplicate product A, creating a duplicate product B
    image

  2. Edit product B, change the URL Key under "Search Engine Optimization" while leaving "Create Permanent Redirect for old URL" checked and save the product
    image
    image

  3. Open product A

  4. Save and duplicate product A again in an attempt to create product C

Expected result

  1. A workflow that lets me duplicate the product by e.g. changing the URL Key.

Actual result

  1. Warning The value specified in the URL Key field would generate a URL that already exists.
    image
  2. Products don't have url key product-a-1 but product A cannot be duplicated again
    image

Original descirption

Preconditions

  1. 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)
  1. Some categories of which some are imported from m1.6.2 (with earlier m2 version)
  2. URLRewrites for these products and categories

Steps to reproduce

  1. Open an old product, click on "Save and duplicate"

Expected result

  1. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: SEOComponent: UrlIssue: 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.Progress: PR in progressReproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchTriage: Dev.ExperienceIssue related to Developer Experience and needs help with Triage to Confirm or Reject it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions