File tree Expand file tree Collapse file tree 2 files changed +20
-4
lines changed
Controller/Adminhtml/Product Expand file tree Collapse file tree 2 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -75,17 +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
- ]
96
+ $ formActionParams
89
97
),
90
98
'method ' => 'post ' ,
91
99
],
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