You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At a certain point after saving a category, the category would go through a redirect loop when I would navigate to it. Products were also having the same issue.
I began looking into it by looking into the Magento\UrlRewrite\Controller\Router::Match() method.
I found that the getRewrite() method was trimming forward slash ("/") characters from the $requestPath variable passed in. This was matching an entity in the "url_rewrite" table with 301 redirect every time.
In the "url_rewrite" table of my database, I had 2 entries that matched the category path. Example:
The issue was that the getRewrite() method of the controller was trimming slashes ("/") from $requestPath and always matching the 301 redirect entry.
I did something dirty: I touched core code. All I did was change the trim() function call to ltrim() in the getRewrite() method. Everything seems to be working fine.
Can anybody think of something else that would be causing this? If the trim() method is being called in the getRewrite() method, then any entry in the database ending with a forward slash ("/") should never be matched.
The text was updated successfully, but these errors were encountered:
@LoganGS thank you for your feedback.
Please, format this issue according to the Issue reporting guidelines: with steps to reproduce, actual result and expected result.
According to contributor guide, tickets without response for two weeks should be closed.
If this issue still reproducible please feel free to create the new one: format new issue according to the Issue reporting guidelines: with steps to reproduce, actual result and expected result and specify Magento version.
I am not certain when this began happening, but:
At a certain point after saving a category, the category would go through a redirect loop when I would navigate to it. Products were also having the same issue.
I began looking into it by looking into the Magento\UrlRewrite\Controller\Router::Match() method.
I found that the getRewrite() method was trimming forward slash ("/") characters from the $requestPath variable passed in. This was matching an entity in the "url_rewrite" table with 301 redirect every time.
In the "url_rewrite" table of my database, I had 2 entries that matched the category path. Example:
The issue was that the getRewrite() method of the controller was trimming slashes ("/") from $requestPath and always matching the 301 redirect entry.
I did something dirty: I touched core code. All I did was change the trim() function call to ltrim() in the getRewrite() method. Everything seems to be working fine.
Can anybody think of something else that would be causing this? If the trim() method is being called in the getRewrite() method, then any entry in the database ending with a forward slash ("/") should never be matched.
The text was updated successfully, but these errors were encountered: