-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Product URL rewrite is not removed when switching visibility #10725
Comments
I found the cause of the problem: when saving a product, the However, the rewrite is saved in the database table with store_id 1, and |
Did you ever change single-store mode setting? Please extend description with this information then. |
@orlangur: no, this is just a default installation. But I analyzed the code and the observer in question doesn't check for that configuration setting. It just asks the store ID from the product that is being saved, which is 0 for the admin/default store values, but the url rewrites are saved on a per-store base, so ID 0 is never used there. |
i take it |
Hi @kanduvisla i'm closing this one as we have new issue, -> #20434 |
@kanduvisla, thank you for your report. Unfortunately, we are archiving this ticket now as it did not get much attention from both Magento Community and Core developers for an extended period. This is done in an effort to create a quality, community-driven backlog which will allow us to allocate the required attention more easily. Please feel free to comment, reopen or create new ticket according to the Issue reporting guidelines |
4 years later, issue is still present |
I know there are a lot of URL rewrite-related issues, but this one is very clear and reproducible.
Preconditions
Steps to reproduce
Expected result
I expected the record to be deleted as soon as a product is set back to not visible (or even disabled). Because now, a new product that has the same url key cannot be saved. This is especially useful in a scenario where new products are imported (using Magento's repository/save method), and old products are disabled or made not visible in the process.
Actual result
The url_key remains in the url_rewrite table, making it impossible for future products to have the same url_key as a product that has been disabled or made invisible in the past.
I thought about if this is a bug or a feature because if it would be a feature, I would expect the url_key to be generated as well when I create a new, non-visible product. However, this is not the case. So either the url_key should be created always, or it should only be created when the status and/or visibility allow it (and it should be cleaned up if not).
The text was updated successfully, but these errors were encountered: