Skip to content

The URL Key field would generate a URL that already exists #23169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
huyphan261 opened this issue Jun 7, 2019 · 11 comments
Closed

The URL Key field would generate a URL that already exists #23169

huyphan261 opened this issue Jun 7, 2019 · 11 comments
Labels
Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed

Comments

@huyphan261
Copy link

Preconditions (*)

  1. Magento CE 2.2.7 without sample data is installed.
  2. Products import from old shop

Steps to reproduce (*)

  1. Go to backend
  2. Go to manage products
  3. Search any product
  4. Try to add Parent category of sub-category

Expected result (*)

  1. [Screenshots, logs or description]
    Can not save product with new category
    image
    image

Actual result (*)

  1. [Screenshots, logs or description]
    Can not save product with new category
    image
@m2-assistant
Copy link

m2-assistant bot commented Jun 7, 2019

Hi @huyphan261. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@huyphan261 do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Jun 7, 2019
@orlangur
Copy link
Contributor

orlangur commented Jun 7, 2019

@huyphan261 did you set Use Category URL to Yes?

@ghost ghost self-assigned this Jun 7, 2019
@m2-assistant
Copy link

m2-assistant bot commented Jun 7, 2019

Hi @engcom-backlog-nazar. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Verify that the issue is reproducible on 2.2-develop branch.

    Details- Add the comment @magento give me 2.2-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.2-develop branch, please add the label Reproduced on 2.2.x

  • 6. Add label Issue: Confirmed once verification is complete.

  • 7. Make sure that automatic system confirms that report has been added to the backlog.

@ghost
Copy link

ghost commented Jun 7, 2019

@magento give me 2.2-develop instance

@magento-engcom-team
Copy link
Contributor

Hi @engcom-backlog-nazar. Thank you for your request. I'm working on Magento 2.2-develop instance for you

@magento-engcom-team
Copy link
Contributor

Hi @engcom-backlog-nazar, here is your Magento instance.
Admin access: https://i-23169-2-2-develop.instances.magento-community.engineering/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@ghost
Copy link

ghost commented Jun 7, 2019

Hi @huyphan261 thank you for you report, i'm not able to reproduce following steps you described on clean magento 2.2-develop , seems like this related your configuration or custom modules, thanks for collaboration.

@ghost ghost closed this as completed Jun 7, 2019
@huyphan261
Copy link
Author

@huyphan261 did you set Use Category URL to Yes?

where can I set it?

@huyphan261
Copy link
Author

Hi @huyphan261 thank you for you report, i'm not able to reproduce following steps you described on clean magento 2.2-develop , seems like this related your configuration or custom modules, thanks for collaboration.

Hi there, I imported product from magento 1

@hostep
Copy link
Contributor

hostep commented Jun 10, 2019

@huyphan261: if you've used Magento's official data migration tool, it transfers over the url_path attribute from Magento 1 to Magento 2, even though Magento 2 never populates this field and it should always be empty, but M2 still uses it for generating url rewrites if it is in fact filled in. This might cause the problem you are experiencing. This bug is being tracked in magento/data-migration-tool#541 & magento/data-migration-tool#462

You might try to remove all attribute values of the url_path product attribute in the database of your M2 shop and see if that resolves this problem. But please, test this first, don't immediately start doing this on a production environment :)

did you set Use Category URL to Yes?

where can I set it?

It's in Stores > Configuration > Catalog > Catalog > Search Engine Optimization > Use Categories Path for Product URLs
But this setting shouldn't matter as Magento's url rewrite mechanism always generates url's with categories in them as well, even it that setting is disabled.
BTW: there will become a new configuration option available in Magento 2.3.2 or 2.3.3 (provided by MC-4244) where you can actually disable this behavior called: Generate "category/product" URL Rewrites.

@huyphan261
Copy link
Author

@huyphan261: if you've used Magento's official data migration tool, it transfers over the url_path attribute from Magento 1 to Magento 2, even though Magento 2 never populates this field and it should always be empty, but M2 still uses it for generating url rewrites if it is in fact filled in. This might cause the problem you are experiencing. This bug is being tracked in magento/data-migration-tool#541 & magento/data-migration-tool#462

You might try to remove all attribute values of the url_path product attribute in the database of your M2 shop and see if that resolves this problem. But please, test this first, don't immediately start doing this on a production environment :)

did you set Use Category URL to Yes?

where can I set it?

It's in Stores > Configuration > Catalog > Catalog > Search Engine Optimization > Use Categories Path for Product URLs
But this setting shouldn't matter as Magento's url rewrite mechanism always generates url's with categories in them as well, even it that setting is disabled.
BTW: there will become a new configuration option available in Magento 2.3.2 or 2.3.3 (provided by MC-4244) where you can actually disable this behavior called: Generate "category/product" URL Rewrites.

I tried but it's not working

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed
Projects
None yet
Development

No branches or pull requests

4 participants