Skip to content

Commit 4c394a9

Browse files
authored
ENGCOM-5195: Fixed wrong url redirect when edit product review from Customer view page #22426
2 parents 3da8288 + 4e3a836 commit 4c394a9

File tree

2 files changed

+16
-5
lines changed
  • app/code/Magento/Review

2 files changed

+16
-5
lines changed

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,25 @@ protected function _prepareForm()
7575
$review = $this->_coreRegistry->registry('review_data');
7676
$product = $this->_productFactory->create()->load($review->getEntityPkValue());
7777

78+
$formActionParams = [
79+
'id' => $this->getRequest()->getParam('id'),
80+
'ret' => $this->_coreRegistry->registry('ret')
81+
];
82+
if ($this->getRequest()->getParam('productId')) {
83+
$formActionParams['productId'] = $this->getRequest()->getParam('productId');
84+
}
85+
if ($this->getRequest()->getParam('customerId')) {
86+
$formActionParams['customerId'] = $this->getRequest()->getParam('customerId');
87+
}
88+
7889
/** @var \Magento\Framework\Data\Form $form */
7990
$form = $this->_formFactory->create(
8091
[
8192
'data' => [
8293
'id' => 'edit_form',
8394
'action' => $this->getUrl(
8495
'review/*/save',
85-
[
86-
'id' => $this->getRequest()->getParam('id'),
87-
'ret' => $this->_coreRegistry->registry('ret'),
88-
'productId' => $this->getRequest()->getParam('productId')
89-
]
96+
$formActionParams
9097
),
9198
'method' => 'post',
9299
],

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ public function execute()
7777
if ($productId) {
7878
$resultRedirect->setPath("catalog/product/edit/id/$productId");
7979
}
80+
$customerId = (int)$this->getRequest()->getParam('customerId');
81+
if ($customerId) {
82+
$resultRedirect->setPath("customer/index/edit/id/$customerId");
83+
}
8084
return $resultRedirect;
8185
}
8286
$resultRedirect->setPath('review/*/');

0 commit comments

Comments
 (0)