File tree Expand file tree Collapse file tree 2 files changed +22
-4
lines changed
Controller/Adminhtml/Product Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change 4
4
* See COPYING.txt for license details.
5
5
*/
6
6
7
+
7
8
/**
8
9
* Adminhtml Review Edit Form
9
10
*/
@@ -69,23 +70,32 @@ public function __construct(
69
70
*
70
71
* @return $this
71
72
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
73
+ * @SuppressWarnings(PHPMD.RequestAwareBlockMethod)
72
74
*/
73
75
protected function _prepareForm ()
74
76
{
75
77
$ review = $ this ->_coreRegistry ->registry ('review_data ' );
76
78
$ product = $ this ->_productFactory ->create ()->load ($ review ->getEntityPkValue ());
77
79
80
+ $ formActionParams =[
81
+ 'id ' => $ this ->getRequest ()->getParam ('id ' ),
82
+ 'ret ' => $ this ->_coreRegistry ->registry ('ret ' )
83
+ ];
84
+ if ($ this ->getRequest ()->getParam ('productId ' )) {
85
+ $ formActionParams ['productId ' ] = $ this ->getRequest ()->getParam ('productId ' );
86
+ }
87
+ if ($ this ->getRequest ()->getParam ('customerId ' )) {
88
+ $ formActionParams ['customerId ' ] = $ this ->getRequest ()->getParam ('customerId ' );
89
+ }
90
+
78
91
/** @var \Magento\Framework\Data\Form $form */
79
92
$ form = $ this ->_formFactory ->create (
80
93
[
81
94
'data ' => [
82
95
'id ' => 'edit_form ' ,
83
96
'action ' => $ this ->getUrl (
84
97
'review/*/save ' ,
85
- [
86
- 'id ' => $ this ->getRequest ()->getParam ('id ' ),
87
- 'ret ' => $ this ->_coreRegistry ->registry ('ret ' )
88
- ]
98
+ $ formActionParams
89
99
),
90
100
'method ' => 'post ' ,
91
101
],
Original file line number Diff line number Diff line change @@ -72,6 +72,14 @@ public function execute()
72
72
} else {
73
73
$ resultRedirect ->setPath ('*/*/ ' );
74
74
}
75
+ $ productId = $ this ->getRequest ()->getParam ('productId ' );
76
+ if ($ productId ) {
77
+ $ resultRedirect ->setPath ("catalog/product/edit/id/ $ productId " );
78
+ }
79
+ $ customerId = (int )$ this ->getRequest ()->getParam ('customerId ' );
80
+ if ($ customerId ) {
81
+ $ resultRedirect ->setPath ("customer/index/edit/id/ $ customerId " );
82
+ }
75
83
return $ resultRedirect ;
76
84
}
77
85
$ resultRedirect ->setPath ('review/*/ ' );
You can’t perform that action at this time.
0 commit comments