Open ctadlock opened 6 years ago
I think the issue is here (https://github.com/experius/Magento2-Module-Experius-ReindexCatalogUrlRewrites/blob/master/Console/Command/RegenerateCategoryUrlCommand.php#L251). If there are, or have been multiple root categories then there are categories under this root category. This code assumes that is not the case. I think a better fix would be to check if request_path != '/'
.
For reference:
@ctadlock
you shouldn't truncate the table but only remove lines with the correct entity type id
@lewisvoncken yes, Im removing the two rows that are causing the issue. I truncated at the start to make sure I have a clean starting point for testing.
@lewisvoncken Also, this has nothing to do with an incorrect entity_type
; they are all category
. The issue is that its generating rewrites for categories with a request_path
of /
when it shouldn't. This is due to the incorrect logic of determining what categories should have rewrites.
@lewisvoncken Any plans to fix this issue?
@ctadlock Are you able to send us a pull request?
@dheesbeen I think you can handle fixing this since this is your code. Ive done my part in throughly identifying and diagnosing the issue.
@dheesbeen here's how I fixed it in our extension; https://github.com/elgentos/regenerate-catalog-urls/commit/6a31dc88c8eba00bca1bdea7f0310283d02d792c
I updated to the latest version of the module (1.2.3), truncated the existing
url-rewrite
table and ranexperius_reindexcatalogurlrewrites:categoryurls
. My home page then had an issue with too may redirects. In order to get it to work; I had to remove two rows in theurl_rewrite
table.Command output..![image](https://user-images.githubusercontent.com/1539397/38177280-b7c1b2c4-35b3-11e8-9b47-da7deb91c420.png)
Had to remove these rows...![image](https://user-images.githubusercontent.com/1539397/38177253-66c2045a-35b3-11e8-9e17-efb1abf8e71e.png)
Default Category
is my root category.