-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Fix For Issue:Incorrect redirect navigate on the review edit page #29318 #30436
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
base: 2.4-develop
Are you sure you want to change the base?
Conversation
Hi @Yash-Bhayani. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
#dmcdindia2020 |
@magento run all tests |
@magento give me test instance |
Hi @rogyar. Thank you for your request. I'm working on Magento instance for you. |
Hi @rogyar, here is your Magento Instance: https://ecf9d8d4bb1e3e9cec36217ff0d2f72f.instances.magento-community.engineering |
if ($fromPath=$this->decoder->decode($this->form->getRequest()->getParam('fromPath'))) { | ||
return $this->getUrl( | ||
$fromPath, | ||
['id' => $this->form->getRequest()->getParam('review_id')] |
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.
I believe we need a universal solution for similar cases instead of fixing particular places. We see the same situation when we go to the customer information page from the order view page. So, we may have a couple more places in the admin panel where we have the same issue with the back button.
It would be great if we could find out how to solve this issue for all occurrences.
Hope it makes sense
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.
Hello, @rogyar! I've done some investigation and I don't see the possibility to make a universal and reasonable solution for all "Back" buttons.
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.
Hi @engcom-Foxtrot. I've been reflected on that for some time and you are right. It's not an easy task unless we have the same name for an entity identifier.
Anyway, thank you for checking!
Hi @Yash-Bhayani. Could I kindly ask you to cover your changes with an MFTF test, please? According to the definition of done all new changes and fixes should be covered by auto-tests. Thank you! |
@magento run all tests |
@rogyar covered, please review. |
@magento run all tests |
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.
Hi @engcom-Foxtrot, can you have a look at my comment below? Thanks!
@@ -32,6 +52,12 @@ public function getButtonData() | |||
*/ | |||
public function getBackUrl() | |||
{ | |||
if ($fromPath=$this->decoder->decode($this->form->getRequest()->getParam('fromPath'))) { |
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.
Instead of adding this parameter from the request, can't we use the RedirectInterface
and the method getRefererUrl
? This should return the URL that the request came from.
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.
@gabrieldagama I don't think it's a good idea. This will cause redirect to any previously opened page and works as the 'back' button in the browser.
Description (*)
This Pull Request is for the resolution of the issue "Incorrect redirect navigate on the review edit page #29318"
The problem is when user redirects to the customer edit page from the product review edit page by clicking on the customer name at the product review page, the user couldn't redirect back to the product review page when it clicks on back button at customer edit page.I resolved this issue.
Changes in File:
app/code/Magento/Review/Block/Adminhtml/Edit/Form.php:135
-> in the link of the author(on click of which we redirected to the customer edit page) i added two additional parameter
(i) fromPath -> so that we can redirect back to the product review page by clicking on back button at customer edit page
(ii) review_id -> using which id parameter is prepared for back button at customer edit page
app/code/Magento/Customer/Block/Adminhtml/Edit/BackButton.php::getBackUrl
-> i used the passed parameter 'fromPath' and 'review_id' parameter to prepare back url for product review edit page
-> i wants the value of passed parameters so i added dependecy injection of \Magento\Customer\Block\Adminhtml\Edit\Form Block class.
in above file i used URL Encoder and URL Decoder so parameter(router/controller/action) passed as the value of 'fromPath' key interpreted currectly
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Testing 1:
Testing 2:
Questions or comments
Contribution checklist (*)