File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed
Controller/Adminhtml/Product Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -75,18 +75,25 @@ protected function _prepareForm()
75
75
$ review = $ this ->_coreRegistry ->registry ('review_data ' );
76
76
$ product = $ this ->_productFactory ->create ()->load ($ review ->getEntityPkValue ());
77
77
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
+
78
89
/** @var \Magento\Framework\Data\Form $form */
79
90
$ form = $ this ->_formFactory ->create (
80
91
[
81
92
'data ' => [
82
93
'id ' => 'edit_form ' ,
83
94
'action ' => $ this ->getUrl (
84
95
'review/*/save ' ,
85
- [
86
- 'id ' => $ this ->getRequest ()->getParam ('id ' ),
87
- 'ret ' => $ this ->_coreRegistry ->registry ('ret ' ),
88
- 'productId ' => $ this ->getRequest ()->getParam ('productId ' )
89
- ]
96
+ $ formActionParams
90
97
),
91
98
'method ' => 'post ' ,
92
99
],
Original file line number Diff line number Diff line change @@ -77,6 +77,10 @@ public function execute()
77
77
if ($ productId ) {
78
78
$ resultRedirect ->setPath ("catalog/product/edit/id/ $ productId " );
79
79
}
80
+ $ customerId = (int )$ this ->getRequest ()->getParam ('customerId ' );
81
+ if ($ customerId ) {
82
+ $ resultRedirect ->setPath ("customer/index/edit/id/ $ customerId " );
83
+ }
80
84
return $ resultRedirect ;
81
85
}
82
86
$ resultRedirect ->setPath ('review/*/ ' );
You can’t perform that action at this time.
0 commit comments