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

Only URLs of first level categories are generated #153

Open leeroybrun opened 2 years ago

leeroybrun commented 2 years ago

Describe the bug The script only generates the URLs of the first level of categories.

Expected behavior It should generate the URLs of all categories and child categories.

To Reproduce We have multiple categories and child categories, and we recently translated them to multiples languages. We wanted to use your module to generate the URL keys of the categories in the new store views using the translated name we set in those store views.

Unfortunately when we run this :

bin/magento ok:urlrewrites:regenerate --entity-type=category

It only regenerate the URL keys of the first level of categories.

Additional context I see in the code (https://github.com/olegkoval/magento2-regenerate_url_rewrites/blob/master/Model/RegenerateCategoryRewrites.php#L257) that you specifically select only top categories, as the products and child categories will be regenerated as well.

But I don't see where the child categories' URLs should then be generated?

My suggestion would be to remove the line https://github.com/olegkoval/magento2-regenerate_url_rewrites/blob/master/Model/RegenerateCategoryRewrites.php#L259 as I don't see it's utility, but maybe I am missing something?

linzw07 commented 2 years ago

same issue

alex5513 commented 2 years ago

Same issue

theflaer commented 2 years ago

Also got this

gkopec commented 1 year ago

Same issue

adammix commented 7 months ago

same issue