magento2-module-url-data-integrity-checker icon indicating copy to clipboard operation
magento2-module-url-data-integrity-checker copied to clipboard

Detect url_key's which aren't normalized

Open hostep opened this issue 5 years ago • 8 comments

We should add some checks to see if url_key's in the database are normalized or not (contain unexpected characters). If they aren't normalized these can cause bad things.

Apparently there was a bug introduced in Magento 2.3.3 (which has been fixed in 2.4.0) which allowed this problem to happen.

So it would be nice if this tool could detect such problems. The bug only existed for product url_keys, but maybe we should also check the categories, you never know ...

hostep avatar Nov 04 '20 13:11 hostep

We seem to have that also in url_path of categories ... not sure which bug caused that. Was that already checked?

amenk avatar Dec 09 '21 10:12 amenk

on the path-check I am also getting

 Category has an incorrect url_path value "freizeitspiele/schwungtuecher". It should be "freizeitspiele/Schwungtücher". Unfortunately this is not easily fixable using the backend of Magento. 

which is kind of wrong ...

amenk avatar Dec 09 '21 11:12 amenk

According to https://github.com/elgentos/regenerate-catalog-urls#faq url_paths can be deleted, so you can ignore my previous comments.

amenk avatar Dec 09 '21 14:12 amenk

@amenk: sorry for the delay, I was away in holiday for the past 3 weeks.

I'm quickly tuning in just to mention that only url_path's for products can be deleted, please don't delete them for categories, those are actually being used!

As for your original question, I'll need to dig in a bit, it does sound like a bug at first sight, but I'll need some time in the coming days to get up to speed with all the things I missed during my holiday.

hostep avatar Dec 13 '21 15:12 hostep

I hope you enjoyed your holiday @hostep - no need to be sorry for the delay :-)

We kind of solved it on staging by regenerating "everything" with the elgentos module and deleting url_path for both, products and categories as well.

In https://github.com/elgentos/regenerate-catalog-urls/issues/48 and the FAQ @peterjaap writes that it's pretty safe to delete url_paths from the categories as well, because the are not kept in sync anymore?

amenk avatar Dec 13 '21 15:12 amenk

The FAQ only mentions products, not categories 😉 But if you are using a tool to regenerate everything and it also regenerates the url_path's for categories, then you should be fine 🙂

hostep avatar Dec 13 '21 16:12 hostep

It does mention categories, but might imply that you regenerate anyways https://github.com/elgentos/regenerate-catalog-urls#why-are-my-category-rewrites-for-a-non-default-storeview-in-the-default-storeviews-language

amenk avatar Dec 13 '21 16:12 amenk

@amenk I updated the faq to not imply that ;)

peterjaap avatar Mar 31 '22 06:03 peterjaap