olegkoval / magento2-regenerate_url_rewrites

Magento 2 extension which add feature of regenerating a url rewrites of products/categories
Academic Free License v3.0
420 stars 117 forks source link

Please don't insert url_key attribute values if the url_key on a specific storeview is the same as in the default values #92

Open hostep opened 5 years ago

hostep commented 5 years ago

Hi!

This was tested on a Magento shop with 2 store views. When you have a product with a url_key set to something on the default storeview but not overwriting it on a specific storeview scope, then after running this tool, it inserts the url_key value something on the 2 storeviews.

This makes it hard to update the url_key for a product, since you then need to manually go through all store views, and update all url_key's.

So if a url_key isn't filled in on a specific store view, it should just inherit it from the default values, and not save it separately in the database.

This might be related to https://github.com/olegkoval/magento2-regenerate_url_rewrites/issues/93

Thanks!

werfu commented 5 years ago

As explained in https://github.com/olegkoval/magento2-regenerate_url_rewrites/pull/78 , this is default behavior. My PR was refused for this reason. However, I will submit soon a PR with the reverse option, that is not to regen URL_key.

hostep commented 5 years ago

Thanks for replying @werfu, I think you are talking about #93.

This ticket (92) is about not generating url keys on storeview level if it already exists on default level. This is very related, but not exactly the same :)

werfu commented 5 years ago

Yeah, I mixed up. I replied in the other thread for clarity purpose.

About this one though, I'm not sure how, but we should check if the current storeview key is using the default or not. In some case, the generated url_key will not be the same as the attribute used for generating the key will be overridden.