1

Well i lost hope on this one, I hope somebody had similar issue

I have a following category structure

-xxx
  -a
   -b
     -f
     -g
     -h
   -c
   -d

xxx is the root category

The paths in the store for the categories f,g,h look now like:

http://page/a/b/f
http://page/a/b/g
http://page/a/b/h

Now I want to change the **-b **category url key to a different one. Lets say, we change -b to -lol

So now the paths for the f,g,h categories should be

http://page/a/lol/f
http://page/a/lol/g
http://page/a/lol/h

But for some reason, one of the categories didn't change the url and was left with the old value:

http://page/a/b/g

So now I change the -lol category to -something

The results I receive are as follow

http://page/a/something/f
http://page/a/lol/g
http://page/a/something/h

What can be possibly the issue here and where could I look for an answer? Saving the categories goes from admin panel, I don't have any features regarding plugins on save, just a magento2 EE edition

I also noticed that the url is not updated in the url-rewrite table (right away, only after the later save), Mb there is some problem with some staging crp?

6
  • Tried reindexing? Feb 25, 2022 at 0:27
  • @ChristophFarnleitner of course Feb 25, 2022 at 9:33
  • Dumb suggestions but, did you tried to update the path directly in database ? After doing that is the new path working ? If it is then I guess this is a workaround. That being said I aggree that something isn't normal. The answer might be in the code process running when you change yours paths.
    – Claims
    Feb 28, 2022 at 16:44
  • didn't try that yet, I will give it a try probably tomorrow :) Feb 28, 2022 at 22:13
  • @GosuPrzmak I have faced this type of issue and mentioned my answer step wise in the below link. can you go through it? magento.stackexchange.com/questions/169352/… Mar 2, 2022 at 15:43

2 Answers 2

1

you should use

olegkoval/magento2-regenerate-url-rewrites

Magento 2 module which regenerates the url-rewrite, using the following link you can get an idea of how to use it.

https://www.measureddesigns.com/magento-2-regenerating-url-rewrites-products-categories/

install extension using

composer require olegkoval/magento2-regenerate-url-rewrites

executes the standard Magento cmds as

  • php bin/magento setup:upgrade

  • php bin/magento setup:static-content:deploy -f

  • php bin/magento cache:flush

and then execute olekoval cmd as

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

1
1

Seems Magento 2 is broken on category saving when you uncheck on a root category 'use default' under the 'url_key' property, then after few saves, it starts to break and some magic is happening, after I reproduced in on a demo online store, I rewrite the category saving :]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.