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

Invert "--no-regen-url-key" to "--regen-url-key" #151

Open Serializator opened 2 years ago

Serializator commented 2 years ago

Summary

Today I've been working on an production issue for a customer of ours involving URL rewrites. I needed to regenerate URL rewrites because something messed up and I decided to use this module to accomplish this task.

When reading the description the module seems to specifically focus on URL rewrites and thus I assumed that it would only act upon URL rewrites and nothing else, unless it was specifically instructed to.

"Magento 2 "Regenerate Url rewrites" extension add a CLI feature which allow to regenerate a Url rewrites of products/categories in all stores or specific store"

It turns out that by default the module regenerates URL keys as well, unless told otherwise. I think that right now this behaviour is intended but in practice might be more problematic than anything else. Causing damage / corrupting data such as URL keys which would then have to be reverted from a backup.

I know that there have been issues about this in the past but I believe this to be an important topic of discussion and I hope rather than saying "it's been like this forever, so lets keep it this way" that there should be an open discussion about it and based on that a decision can be made for the future.

Basic example

I would suggest changing --no-regen-url-key into --regen-url-key to make this side effect more explicit.

Detzler commented 8 months ago

Hi @olegkoval, I've just fkd up all my product url_keys assuming that the extension would only make changes to the url rewrite table. The description of the extension is indeed misleading. Either the descripion should be more obvious or, as @Serializator suggested, the inversion should be made.

I also suggest to go for the inversion.