magento2-regenerate_url_rewrites icon indicating copy to clipboard operation
magento2-regenerate_url_rewrites copied to clipboard

Url_Key not regenerated for child categories

Open sebfie opened this issue 1 year ago • 3 comments

Describe the bug When running bin/magento ok:urlrewrites:regenerate --store-id=6 --category-id=15 --no-reindex

It does not regenerate child categories url_keys but just the parent category (in my case 15)

Expected behavior It should regenerate url_key for all child categories

To Reproduce Run bin/magento ok:urlrewrites:regenerate --store-id=6 --category-id=15 --no-reindex

Additional context Here I do not understand why the level is 2 and not ['gt' => '2']

https://github.com/olegkoval/magento2-regenerate_url_rewrites/blob/master/Model/RegenerateCategoryRewrites.php#LL259C7-L259C7

sebfie avatar Jun 06 '23 10:06 sebfie

I am having the same issue. It seems only the top level categories are being generated but not the child categories. I am using the latest version of the module and magento 2.4.6-p2

pauldonnelly avatar Nov 01 '23 12:11 pauldonnelly

I agree. Also, I think there's a ->setStoreId($storeId) missing in _getCategoriesCollection

Nuranto avatar Jan 19 '24 19:01 Nuranto

the same for url_path it is generated only for the top-level categories it should also generate it for all children

abdel-aouby avatar Feb 02 '24 11:02 abdel-aouby