Skip to content

Commit 29a5cfc

Browse files
author
Oleksii Korshenko
committed
MAGETWO-82559: Fix app/code/Magento/Backend/Block/Media/Uploader.php getConfigJson() method #11665
- Merge Pull Request #11665 from adrian-martinez-interactiv4/magento2:FR#FIX-BLOCK-MEDIA-UPLOADER-GETCONFIGJSON - Merged commits: 1. 724f747
2 parents e7c5bb5 + 724f747 commit 29a5cfc

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

app/code/Magento/Backend/Block/Media/Uploader.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
*/
66
namespace Magento\Backend\Block\Media;
77

8+
use Magento\Framework\App\ObjectManager;
9+
810
/**
911
* Adminhtml media library uploader
1012
* @api
@@ -27,16 +29,25 @@ class Uploader extends \Magento\Backend\Block\Widget
2729
*/
2830
protected $_fileSizeService;
2931

32+
/**
33+
* @var \Magento\Framework\Json\EncoderInterface
34+
*/
35+
protected $_jsonEncoder;
36+
3037
/**
3138
* @param \Magento\Backend\Block\Template\Context $context
3239
* @param \Magento\Framework\File\Size $fileSize
3340
* @param array $data
41+
* @param \Magento\Framework\Json\EncoderInterface $jsonEncoder
3442
*/
3543
public function __construct(
3644
\Magento\Backend\Block\Template\Context $context,
3745
\Magento\Framework\File\Size $fileSize,
38-
array $data = []
46+
array $data = [],
47+
\Magento\Framework\Json\EncoderInterface $jsonEncoder = null
3948
) {
49+
$this->_jsonEncoder = $jsonEncoder ?:
50+
ObjectManager::getInstance()->get(\Magento\Framework\Json\EncoderInterface::class);
4051
$this->_fileSizeService = $fileSize;
4152
parent::__construct($context, $data);
4253
}
@@ -107,7 +118,7 @@ public function getJsObjectName()
107118
*/
108119
public function getConfigJson()
109120
{
110-
return $this->_coreData->jsonEncode($this->getConfig()->getData());
121+
return $this->_jsonEncoder->encode($this->getConfig()->getData());
111122
}
112123

113124
/**

0 commit comments

Comments
 (0)