-
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
Behaviour of URL Key field is different in Magento 2 then in Magento 1 #10242
Comments
Behavior of Magento 1 is totally incorrect from SEO perspective. Generated once URLs shall be preserved and not changed at random point with random numeric suffix. In Magento 2 merchant has full control over generated URLs and resolves any collisions immediately. What should really be improved in Magento 2 instead of restoring poor Magento 1 behavior is:
All referenced issues are easily solvable in current Magento 2 implementation, they just indicated misunderstanding of differences between Magento 1 and Magento 2 URL Rewrite behavior. They are already resolved, there is nothing to "fix". Reimplementing Magento 1 oddities just because of Magento 2 nuances misunderstanding is a road to nowhere as to me. |
Only the @magento-team can tell if this is a bug or a feature. If it's feature, this issue and the related issues can be closed. |
Surely. Many core team members can tell if it is a bug or feature, related issues are already closed. I just tried to give some insight having deep understanding in this area of Magento. URL Rewrites is definitely a pain point currently from usability (especially performance) perspective. I would be glad to hear if something planned in roadmap to improve this as well. |
Issue #6671 has been open for more then a year, which relates to this as well, so I updated this issue with the link. URL rewrites performance is out of scope for this issue, it only deals with the changed URL key field behaviour between Magento 1 and Magento 2. |
This is especially a problem when upgrading from Magento 1, and a pain to fix. |
@mowny why? There will be no URL Rewrites collisions if data migration done properly. |
Hi @orlangur, You're spot on. We've been alerted to a few URLRewrite bugs which we've resolved along with some performance tuning using our current architecture. We have an epic (MAGETWO-69145) that's in my short/medium term backlog to change our architecture to be more efficient in managing large # of URLRewrites. That work includes improved merchant facing notification/resolution of URL conflicts (you'll see some of that in 2.2 and patched back into 2.1.x) and improvements in managing historical URLRewrites. So I'll close with it's complicated, as written this isn't a bug but a feature request to expand our performance envelop of our current URLRewrite architecture. However, we see gaps/issues around usability (bugs) of current URLRewrite architecture that will be resolved in the short term. |
@orlangur Only if the magento 1 database was clean in that regard. We still run into this problem with old (even deactivated) products that have once been duplicated, and the source of the problems is a pain to locate. |
@choukalos why did you close, then reopen and then close this issue again? No comment from Magento why this issue has been closed. So this should still be open because this issue has not been addressed properly. |
@dverkade - sorry for the confusion; basically URLRewrite behavior is as designed and correct but our current architecture/implementation has several issues that need to be resolved and are (mostly) identified as a short/near term feature request ( internal epic MAGETWO-69145 ). Issues (based on this thread, other reported issues, current market research):
So my suggestion would be to
|
Hi @choukalos, Thank you for your reply. I understand that the behaviour of Magento is working as designed, however this does not mean that the chosen design is not flawed. First of all, I'm wondereing what the theory, reasoning and user story was behind this design decision. I hope you will be able to clarify on that. There are some major disadvantages with the design chosen:
I do agree that from a SEO perspective URLs should be persistent, and once they are set should not change randomly. This is something that occurred in Magento 1 under specific circumstances and should be avoided at all costs. I think we should introduce behaviour in order to not only notify but als prevent URL collisions. Magento 2 introduced behaviour in order to deal with SKU collosions, where "-1" or "-2" wil be appended to the SKU when it's already been taken. The user is also notified of this change as well. So in my opinion you are removing such behaviour from Magento 2 on the URL Key field to make sure user input is not changed automatically and Magento 2 introduces it on the SKU field. User story:
Example of notification to a user that a collision in the URL key field occured: How do you feel about introducing the behaviour for checking if an URL key collides and appending for instance "-1" or "-$entityId" to the URL key and notifying the user of this change in the URL key? Just the way it's currently working with the SKU field in Magento 2. I think you have a real workable solution for this and the other issues regarding the URL key. It gives the user complete control over the URL key and you will also be able to save products which somehow got the same URL key (for instance from migrating data from Magento 1). So this issue should definately not be closed as a duplicate, because this issue will not be resolved with performance improvements as mentioned in internal ticket MAGETWO-69145. It's also not solved by notifying merchant about the collisions. Magento should take care of this for the merchant and give them the ability to change or overwrite the URL key when they like to do so. As mentioned earlier I have know deep knowledge of the url-rewrite and catalog-url-rewrite modules, so I'm happy to help you out on the issues regarding the URL rewrites. |
This could happen in the past and was fixed in magento/data-migration-tool#81. Just provide additional details if you still experiencing the problem. Not commenting other items as they are irrelevant. |
@dverkade |
Something I found very Usefull was the comment from @mowny "We still run into this problem with old (even deactivated) products that have once been duplicated, and the source of the problems is a pain to locate." If you have folks on your team that disable a product then create a new one and enable that with the same url key you will get your {SEO url} + {Entity ID} This url key issue was noticed by our team because when the products are saved the url changes Entity ID and google creates 404's in search Console. Would almost be better if you couldn't even save a second thing with the same url key to avoid this. |
The behaviour of the URL Key field is different in Magento 2 then in Magento 1. This might be a (undocumented) feature of Magento 2 or a bug.
Preconditions
Steps to reproduce
Expected result
Actual result
Causes
Debugging
Did some digging into Magento 1. In the class Mage_Catalog_Model_Url the following code is executed in order to check if the request path is available and saves only the correct path. This behaviour is not present in Magento 2.
$validatedPath = $this->getResource()->checkRequestPaths( array($requestPath.$suffix, $requestPath.'-'.$product->getId().$suffix), $storeId );
The text was updated successfully, but these errors were encountered: