6
6
namespace Magento \Catalog \Controller \Adminhtml \Product \Widget ;
7
7
8
8
use Magento \Framework \Exception \NotFoundException ;
9
+ use Magento \Framework \App \ObjectManager ;
9
10
10
11
/**
11
12
* Chooser Product container Action.
@@ -38,18 +39,18 @@ class Chooser extends \Magento\Backend\App\Action
38
39
* @param \Magento\Backend\App\Action\Context $context
39
40
* @param \Magento\Framework\Controller\Result\RawFactory $resultRawFactory
40
41
* @param \Magento\Framework\View\LayoutFactory $layoutFactory
41
- * @param \Magento\Framework\Escaper $escaper
42
+ * @param \Magento\Framework\Escaper|null $escaper
42
43
*/
43
44
public function __construct (
44
45
\Magento \Backend \App \Action \Context $ context ,
45
46
\Magento \Framework \Controller \Result \RawFactory $ resultRawFactory ,
46
47
\Magento \Framework \View \LayoutFactory $ layoutFactory ,
47
- \Magento \Framework \Escaper $ escaper
48
+ \Magento \Framework \Escaper $ escaper = null
48
49
) {
49
50
parent ::__construct ($ context );
50
51
$ this ->resultRawFactory = $ resultRawFactory ;
51
52
$ this ->layoutFactory = $ layoutFactory ;
52
- $ this ->escaper = $ escaper ;
53
+ $ this ->escaper = $ escaper ?: ObjectManager:: getInstance ()-> create (\ Magento \ Framework \Escaper::class) ;
53
54
}
54
55
55
56
/**
@@ -77,8 +78,8 @@ public function execute()
77
78
'id ' => $ this ->escaper ->escapeHtml ($ uniqId ),
78
79
'use_massaction ' => $ massAction ,
79
80
'product_type_id ' => $ productTypeId ,
80
- 'category_id ' => $ this ->getRequest ()->getParam ('category_id ' ),
81
- ]
81
+ 'category_id ' => ( int ) $ this ->getRequest ()->getParam ('category_id ' ),
82
+ ],
82
83
]
83
84
);
84
85
@@ -93,7 +94,7 @@ public function execute()
93
94
'id ' => $ this ->escaper ->escapeHtml ($ uniqId ) . 'Tree ' ,
94
95
'node_click_listener ' => $ productsGrid ->getCategoryClickListenerJs (),
95
96
'with_empty_node ' => true ,
96
- ]
97
+ ],
97
98
]
98
99
);
99
100
0 commit comments