-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #20309 - URL Rewrites redirect loop #26902
Fix #20309 - URL Rewrites redirect loop #26902
Conversation
Hi @Bartlomiejsz. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
b39059e
to
b8f43c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Bartlomiejsz,
Your changes looks good, but there is some nitration test failure. Could you fix it?
b8f43c3
to
684b951
Compare
@ihor-sviziev done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Bartlomiejsz,
URL rewrites it quite complex thing, and there is a lot of potential issues. Thank you so much for covering your changes with unit tests, but I think it's better to cover this change with integration tests. Will you be able to do that?
Recently there were fix for URL rewrites, it was covered by integration tests, I think it's good example. Use cases were defined here:
#18717 (comment)
I've did integration test coverage for such cases:
b1a2a29
Note: seems like there not just one case, there should be also checked cases with get params
Pull Request state was updated. Re-review required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above
Hi @ihor-sviziev, |
@Bartlomiejsz not sure if I'll have free time to help you. But actually integration tests are quire similar to and even maybe simpler than unit tests, let's try. Please try following instruction: |
26de9f7
to
ec3cdb9
Compare
…gration test cases
ec3cdb9
to
0fd6fd3
Compare
@Bartlomiejsz Good job! Approved! |
Hi @ihor-sviziev, thank you for the review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Bartlomiejsz , @ihor-sviziev this PR implements only one point from #25848 (review):
adjust logic to do NOT perform redirect in case of target path equal to request path
But there is no implemented patch that will find & delete all such incorrect URL
and no validation for same request-path
and target_path
in admin.
Now behavior with PR is next:
- Url Rewrite with request-path: foo and target_path foo with 301 or 302 redirect is successfully created
- Getting
404 Page not found
error when such url was requested
Is this expected behavior of PR?
Pull Request state was updated. Re-review required.
Hi @engcom-Delta, as @ihor-sviziev mentioned there, those two options, and I'm pretty sure the one implemented in current PR makes second not needed. Because even with those rewrites being still in database, no issue should be spotted on FE. |
@engcom-Delta i totally agree with @Bartlomiejsz . What you’ve shown - expected result. What you said - it could be improved, but main issue is fixed by this PR |
Hi @ihor-sviziev, thank you for the review. |
✔️ QA passed |
Hi @Bartlomiejsz, thank you for your contribution! |
Description (*)
This is fix for #20309 - as @ihor-sviziev mentioned in #25848 (review) - adding validation for such redirect wouldn't fix the issue for i.e. existing stores. So I added check in url rewrite router, which doesn't allow to redirect if request path is equal to target path.
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Please check fixed issue for steps to test
Questions or comments
Contribution checklist (*)