Skip to content

Commit 0d53494

Browse files
committed
MAGETWO-96921: Minor changes in Product Widget Chooser
1 parent 1e8e460 commit 0d53494

File tree

1 file changed

+7
-6
lines changed
  • app/code/Magento/Catalog/Controller/Adminhtml/Product/Widget

1 file changed

+7
-6
lines changed

app/code/Magento/Catalog/Controller/Adminhtml/Product/Widget/Chooser.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Catalog\Controller\Adminhtml\Product\Widget;
77

88
use Magento\Framework\Exception\NotFoundException;
9+
use Magento\Framework\App\ObjectManager;
910

1011
/**
1112
* Chooser Product container Action.
@@ -38,18 +39,18 @@ class Chooser extends \Magento\Backend\App\Action
3839
* @param \Magento\Backend\App\Action\Context $context
3940
* @param \Magento\Framework\Controller\Result\RawFactory $resultRawFactory
4041
* @param \Magento\Framework\View\LayoutFactory $layoutFactory
41-
* @param \Magento\Framework\Escaper $escaper
42+
* @param \Magento\Framework\Escaper|null $escaper
4243
*/
4344
public function __construct(
4445
\Magento\Backend\App\Action\Context $context,
4546
\Magento\Framework\Controller\Result\RawFactory $resultRawFactory,
4647
\Magento\Framework\View\LayoutFactory $layoutFactory,
47-
\Magento\Framework\Escaper $escaper
48+
\Magento\Framework\Escaper $escaper = null
4849
) {
4950
parent::__construct($context);
5051
$this->resultRawFactory = $resultRawFactory;
5152
$this->layoutFactory = $layoutFactory;
52-
$this->escaper = $escaper;
53+
$this->escaper = $escaper ?: ObjectManager::getInstance()->create(\Magento\Framework\Escaper::class);
5354
}
5455

5556
/**
@@ -77,8 +78,8 @@ public function execute()
7778
'id' => $this->escaper->escapeHtml($uniqId),
7879
'use_massaction' => $massAction,
7980
'product_type_id' => $productTypeId,
80-
'category_id' => $this->getRequest()->getParam('category_id'),
81-
]
81+
'category_id' => (int)$this->getRequest()->getParam('category_id'),
82+
],
8283
]
8384
);
8485

@@ -93,7 +94,7 @@ public function execute()
9394
'id' => $this->escaper->escapeHtml($uniqId) . 'Tree',
9495
'node_click_listener' => $productsGrid->getCategoryClickListenerJs(),
9596
'with_empty_node' => true,
96-
]
97+
],
9798
]
9899
);
99100

0 commit comments

Comments
 (0)