Skip to content
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

Invisible products do not update url_rewrite properly #19293

Open
dverkade opened this issue Nov 21, 2018 · 23 comments
Open

Invisible products do not update url_rewrite properly #19293

dverkade opened this issue Nov 21, 2018 · 23 comments
Labels
Area: Product Component: UrlRewrite Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: ready for dev Reported on 2.4.x Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@dverkade
Copy link
Member

dverkade commented Nov 21, 2018

Preconditions

  1. Magento 2.4-develop

Steps to reproduce

  1. Have a product in the Magento backoffice with the visibility "Not visible individually". Set the URL key of the product to "product-a"
  2. Open the product in de backoffice and change the URL Key to "product-b" and check the "create permanent redirect" checkbox
  3. Save the product.
  4. Open the product again, change the visibility of the product to "Catalog, search" and change the URL key to "product-c", check the "create permanent redirect" checkbox.
  5. Save the product again.

Expected result

  1. Permanent redirects should be present in the url rewrite database table from product-a to product-b
  2. Permanent redirects should be present in the url rewrite database table from product-b to product-c
  3. Expected result is that URL rewrite of products with "not individually visible" will also update.

Actual result (*)

  1. In the URL rewrite database table, only a references to product-c are available and permanent redirects from product-b to product-c are available.
  2. product-a is not redirecting to product-b
  3. URL rewrites for products which where once visible and now are not visible anymore are not being updated anymore and the old URL key which was present when the product was still visible is being kept in the URL rewrite table.
@magento-engcom-team magento-engcom-team added the Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed label Nov 21, 2018
@magento-engcom-team
Copy link
Contributor

magento-engcom-team commented Nov 21, 2018

Hi @dverkade. 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.

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

  • yes
  • no

@dverkade
Copy link
Member Author

dverkade commented Nov 21, 2018

There are 2 possible solutions for this:

  • Either, when you set a product from visible to not visible the URL rewrites for that given product which are already in the URL rewrite table will be removed.
  • We update the URL rewrite for the product whether the product is visible or not.

Please advice about the best possible solution for this use case.

dverkade added a commit to creaminternet/magento2-opensource that referenced this issue Nov 21, 2018
@orlangur
Copy link
Contributor

URL rewrites for products which where once visible and now are not visible anymore are not being updated anymore and the old URL key which was present when the product was still visible is being kept in the URL rewrite table.

@dverkade this is correct behavior, please adjust description accordingly. Redirects should work the way you described I believe.

@ghost ghost self-assigned this Nov 21, 2018
@magento-engcom-team
Copy link
Contributor

magento-engcom-team commented Nov 21, 2018

Hi @engcom-backlog-andrii. 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 the Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed label Nov 21, 2018
@ghost
Copy link

ghost commented Nov 21, 2018

Hi @dverkade i'm not able to reproduce following steps you described, this is correct behavior, as mentioned a @orlangur , this is not a bug, if you like to update this please reopen the issue.

@ghost ghost closed this as completed Nov 21, 2018
@dverkade
Copy link
Member Author

dverkade commented Nov 21, 2018

I have created a screen capture to show you the issues and that the proces is not consequent. Hope this helps.

Screen capture: https://www.flickr.com/photos/danny-anouk/44173445060

  1. Create SKU "test product a" which is visible, URL key is saved in "url_rewrite" table (issue if item 4 is not an issue)
  2. Create SKU "test product b" which is not visible, URL key is not saved in "url_rewrite" table
  3. Switching visibility from SKU "test product b" to visible, URL key is saved in the "url_rewrite" table.
  4. Switching visibility from SKU "test product b" to not visible, URL key is still present in "url_rewrite" table and is not removed (issue if item 1 is not an issue)
  5. Changing URL key for SKU "test product a" to "test-product-b", product can't be saved because of URL key still present in the "url_rewrite" table.
  6. Changing URL key for SKU "test product b" to "test-product-c". URL key is not updated in the "url_rewrite" table because the product is not visible. (issue, because when again doing item number 5 it still throws an error because the URL key is already taken)
  7. Changing visibility from SKU "test product b" to visible. URL key is updated in the "url_rewrite" table and created a permanent redirect from the previous URL key.
  8. Changing visibility from SKU "test product b" to not visible and changing the URL key to "test-product-d". I do not want to create a permanent redirect. However when we switch the product from not visible to visible again it creates a permanent redirect (issue, because I didn't want a permanent URL rewrite to be created, I just wanted to change the URL key)

@dverkade dverkade reopened this Nov 21, 2018
@orlangur
Copy link
Contributor

@engcom-backlog-nazar, I was only saying that

URL rewrites for products which where once visible and now are not visible anymore are not being updated anymore and the old URL key which was present when the product was still visible is being kept in the URL rewrite table.

does not seem to be correct to me while two other points are valid.

@ghost
Copy link

ghost commented Nov 22, 2018

Changing visibility from SKU "test product b" to not visible and changing the URL key to "test-product-d". I do not want to create a permanent redirect. However when we switch the product from not visible to visible again it creates a permanent redirect (issue, because I didn't want a permanent URL rewrite to be created, I just wanted to change the URL key)

@orlangur Yes now clear, this is not correct.

@ghost ghost added Component: CatalogUrlRewrite Component: UrlRewrite Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed and removed Progress: needs update labels Nov 22, 2018
@magento-engcom-team
Copy link
Contributor

@engcom-backlog-nazar Thank you for verifying the issue. Based on the provided information internal tickets MAGETWO-96573, MAGETWO-96574 were created

@magento-engcom-team magento-engcom-team added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Nov 22, 2018
@ghost ghost removed their assignment Nov 22, 2018
@dverkade
Copy link
Member Author

@engcom-backlog-nazar @orlangur So this issue has been split into 2 different internal JIRA tickets. Can you give some pointers what is should be the intended behaviour of Magento, so that I can work on a PR to resolve this?

@orlangur
Copy link
Contributor

@dverkade two issues are just for 2.2.x/2.3.x.

When product becomes invisible, URL Rewrite should remain in the database.

URL key is not updated in the "url_rewrite" table because the product is not visible

Should be updated in this case, I believe.

@hardik-krish hardik-krish self-assigned this Nov 24, 2018
@magento-engcom-team
Copy link
Contributor

Hi @hardik-krish. Thank you for working on this issue.
Looks like this issue is already verified and confirmed. But if your want to validate it one more time, please, go though the following instruction:

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

  • 2. 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!

  • 3. 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

  • 4. If the issue is not relevant or is not reproducible any more, feel free to close it.

@hardik-krish hardik-krish removed their assignment Nov 24, 2018
@panteliskopsias
Copy link

Did you find any fix on this?
I need the url rewrites in invisible products too. I need it because i export this urls in products feeds, ads and price comparison sites.
From there when a user click on the product, he redirect to the configurable product with the option of simple preselected.
The only way i can do it now is to create the products one by one with visibility 1,2 or 3 and then set it as not visible individually.
Thank you

@engcom-Alfa engcom-Alfa added Area: Product Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed and removed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Aug 25, 2021
@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.magento.com/browse/AC-1012 is successfully created for this GitHub issue.

@m2-assistant
Copy link

m2-assistant bot commented Aug 25, 2021

✅ Confirmed by @engcom-Alfa. Thank you for verifying the issue.
Issue Available: @engcom-Alfa, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@kanevbg
Copy link

kanevbg commented Mar 14, 2023

up

@dverkade
Copy link
Member Author

dverkade commented Mar 15, 2023

Found the following in the release notes for Magento 2.4.6: https://experienceleague.adobe.com/docs/commerce-operations/release/notes/magento-open-source/2-4-6.html?lang=en#url-rewrites

Changing product visibility to Not Visible Individually in the global All Store Views scope now removes only URL rewrites for store views that have not overridden the visibility attribute. Changing product visibility in this way also generates URL rewrites for all store views including those that have overridden the URL key attribute (but not the visibility setting). Previously, URL-rewrite rules were not applied when visibility settings changed.

Seems that this issue has been fixed @engcom-Hotel @engcom-Alfa are you able to check the issue in the internal Jira instance and close this issue if it's been solved in Magento 2.4.6 and tag this accordingly?

@engcom-Hotel
Copy link
Contributor

Hello @dverkade,

Reverified the issue in fresh Magento 2.4-develop installation. but it seems the issue is not resolved yet. In fresh magento installation w/o sample data, in the url_rewrite table, we have only 5 entries as below:

image

Still, we are not able to see the expected result as mentioned in the main description.

Let us know if we have missed anything.

Thanks

@engcom-Hotel engcom-Hotel moved this to Ready for Development in High Priority Backlog Aug 19, 2024
@engcom-Bravo
Copy link
Contributor

Hi @dverkade,

Thanks for your reporting and collaboration.

We have reverified the issue in Latest 2.4-develop instance and the issue is still reproducible.Kindly refer the screenshots.

Screenshot 2024-10-23 at 11 02 25

In the URL rewrite database table, only a references to product-c are available and permanent redirects from product-b to product-c are available.

Hence Confirming the issue.

Thanks.

@engcom-Bravo engcom-Bravo added Reported on 2.4.x Indicates original Magento version for the Issue report. Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Area: Product and removed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Component: CatalogUrlRewrite Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. Area: Product Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed labels Oct 23, 2024
@github-jira-sync-bot
Copy link

❌ Cannot export the issue. This GitHub issue is already linked to Jira issue(s): https://jira.corp.adobe.com/browse/AC-1012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Product Component: UrlRewrite Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: ready for dev Reported on 2.4.x Indicates original Magento version for the Issue report. Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
None yet
Development

Successfully merging a pull request may close this issue.