Skip to content

Product Import -> Missing categories entry in importfile removes url rewrites #18269

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
ulftietze opened this issue Sep 26, 2018 · 6 comments
Closed
Labels
Component: CatalogUrlRewrite Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed

Comments

@ulftietze
Copy link
Member

Preconditions

  1. Magento 2.2.X | probably 2.3 as well
  2. PHP 7.0 | 7.1
  3. Would be nice to have 2 or more websites

Steps to reproduce

  1. Shop contains an existing product with at least following informations:
sku categories url_key product_websites
123456789 Default Category/ExistingCategory1,Default Category/ExistingCategory2 custom-url-key-for-product-123456789 de,at

Attributes like: name | price | url_key | attribute_set_code doesnt matter here.
Actually only interesting point here is: product_websites, but im going to explain later

  1. URL Rewrite contains following informations, because first time everything was imported successfully and completely:
url_rewrite_id entity_type entity_id request_path target_path redirect_type store_id description is_autogenerated metadata
1 product 1 custom-url-key-for-product-123456789/ catalog/product/view/id/1 0 1 NULL 1 NULL
2 product 1 custom-url-key-for-product-123456789/ catalog/product/view/id/1 0 2 NULL 1 NULL
3 product 1 existingcategory1/custom-url-key-for-product-123456789/ catalog/product/view/id/1/category/1 0 1 NULL 1 {"category_id":"1"}
4 product 1 existingcategory1/custom-url-key-for-product-123456789/ catalog/product/view/id/1/category/1 0 2 NULL 1 {"category_id":"1"}
5 product 1 existingcategory2/custom-url-key-for-product-123456789/ catalog/product/view/id/1/category/2 0 1 NULL 1 {"category_id":"2"}
6 product 1 existingcategory2/custom-url-key-for-product-123456789/ catalog/product/view/id/1/category/2 0 2 NULL 1 {"category_id":"2"}
  1. Import csv with following information (just removed the category information)
sku url_key product_websites store_view_code
123456789 custom-url-key-for-product-123456789 de,at
123456789 custom-url-key-for-product-123456789-de de
123456789 custom-url-key-for-product-123456789-at at
  1. This also works with following csv
  2. Import csv with following information (just removed the category information)
sku url_key product_websites
123456789 custom-url-key-for-product-123456789 de,at

Expected result

  1. The Url Rewrite Table looks the same as before, because we doesn't change any categories and wanted them inside too!

Actual result

  1. Just the follwing information are inside of the url_rewrite table:
url_rewrite_id entity_type entity_id request_path target_path redirect_type store_id description is_autogenerated metadata
1 product 1 custom-url-key-for-product-123456789/ catalog/product/view/id/1 0 1 NULL 1 NULL
2 product 1 custom-url-key-for-product-123456789/ catalog/product/view/id/1 0 2 NULL 1 NULL

Conclusion:

So if you provide an url key but no categories, Magento deletes the existing category url rewrites.
One missing point:

  • if you forgot to provide product_websites in your csv file, no url_rewrite is generated or updated. This behavior may be here by default, but i think it's better to renew all information about if the url_key has changed.

Greetz,
Ulf

@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Sep 26, 2018
@magento-engcom-team
Copy link
Contributor

Hi @ulftietze. 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-engcom-team give me $VERSION instance

where $VERSION is version tags (starting from 2.2.0+) or develop branches (for example: 2.3-develop).
For more details, please, review the Magento Contributor Assistant documentation.

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

  • yes
  • no

@ghost ghost self-assigned this Sep 27, 2018
@magento-engcom-team
Copy link
Contributor

magento-engcom-team commented Sep 27, 2018

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-engcom-team 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-engcom-team 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 Sep 27, 2018

Hi @ulftietze it looks like this is duplicate to your issue -> #18234? maybe just edit referenced issue.

@ghost ghost removed their assignment Sep 27, 2018
@ulftietze
Copy link
Member Author

ulftietze commented Sep 27, 2018

Hey @engcom-backlog-nazar,

no this is not a duplicate due to the product categorie url rewrites now.
In #18234 we deal with the category url rewrites during creation. This time we have problems with individual product rewrites.
Have a look on my description, this are rewrites with entity_type "product".

I already have a fix for this, but first i have to write/fix some unit test ^^

@magento-engcom-team
Copy link
Contributor

magento-engcom-team commented Nov 7, 2018

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-engcom-team 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-engcom-team 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 ghost added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Component: CatalogUrlRewrite labels Nov 7, 2018
@ghost
Copy link

ghost commented Nov 8, 2018

Hi @ulftietze thank you for you report, this issue has already fixed in 2.3-develop branch.

@ghost ghost closed this as completed Nov 8, 2018
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: CatalogUrlRewrite Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed
Projects
None yet
Development

No branches or pull requests

2 participants