Skip to content

Commit a628e74

Browse files
authored
ENGCOM-4719: Fixed wrong url redirect when edit product review from product view page #22202
2 parents 7123f7e + 6a71bb6 commit a628e74

File tree

2 files changed

+8
-3
lines changed
  • app/code/Magento/Review

2 files changed

+8
-3
lines changed

app/code/Magento/Review/Block/Adminhtml/Edit/Form.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
* See COPYING.txt for license details.
55
*/
66

7+
namespace Magento\Review\Block\Adminhtml\Edit;
8+
79
/**
810
* Adminhtml Review Edit Form
911
*/
10-
namespace Magento\Review\Block\Adminhtml\Edit;
11-
1212
class Form extends \Magento\Backend\Block\Widget\Form\Generic
1313
{
1414
/**
@@ -84,7 +84,8 @@ protected function _prepareForm()
8484
'review/*/save',
8585
[
8686
'id' => $this->getRequest()->getParam('id'),
87-
'ret' => $this->_coreRegistry->registry('ret')
87+
'ret' => $this->_coreRegistry->registry('ret'),
88+
'productId' => $this->getRequest()->getParam('productId')
8889
]
8990
),
9091
'method' => 'post',

app/code/Magento/Review/Controller/Adminhtml/Product/Save.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ public function execute()
7373
} else {
7474
$resultRedirect->setPath('*/*/');
7575
}
76+
$productId = (int)$this->getRequest()->getParam('productId');
77+
if ($productId) {
78+
$resultRedirect->setPath("catalog/product/edit/id/$productId");
79+
}
7680
return $resultRedirect;
7781
}
7882
$resultRedirect->setPath('review/*/');

0 commit comments

Comments
 (0)