Skip to content

Commit b1c3b6e

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. 2d6458a 2. 6f72198
2 parents 9ed7081 + 6f72198 commit b1c3b6e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
namespace Magento\Backend\Block\Media;
77

88
use Magento\Framework\App\ObjectManager;
9+
use Magento\Framework\Serialize\Serializer\Json;
910

1011
/**
1112
* Adminhtml media library uploader
@@ -30,25 +31,24 @@ class Uploader extends \Magento\Backend\Block\Widget
3031
protected $_fileSizeService;
3132

3233
/**
33-
* @var \Magento\Framework\Json\EncoderInterface
34+
* @var Json
3435
*/
35-
protected $_jsonEncoder;
36+
private $jsonEncoder;
3637

3738
/**
3839
* @param \Magento\Backend\Block\Template\Context $context
3940
* @param \Magento\Framework\File\Size $fileSize
4041
* @param array $data
41-
* @param \Magento\Framework\Json\EncoderInterface $jsonEncoder
42+
* @param Json $jsonEncoder
4243
*/
4344
public function __construct(
4445
\Magento\Backend\Block\Template\Context $context,
4546
\Magento\Framework\File\Size $fileSize,
4647
array $data = [],
47-
\Magento\Framework\Json\EncoderInterface $jsonEncoder = null
48+
Json $jsonEncoder = null
4849
) {
49-
$this->_jsonEncoder = $jsonEncoder ?:
50-
ObjectManager::getInstance()->get(\Magento\Framework\Json\EncoderInterface::class);
5150
$this->_fileSizeService = $fileSize;
51+
$this->jsonEncoder = $jsonEncoder ?: ObjectManager::getInstance()->get(Json::class);
5252
parent::__construct($context, $data);
5353
}
5454

@@ -118,7 +118,7 @@ public function getJsObjectName()
118118
*/
119119
public function getConfigJson()
120120
{
121-
return $this->_jsonEncoder->encode($this->getConfig()->getData());
121+
return $this->jsonEncoder->encode($this->getConfig()->getData());
122122
}
123123

124124
/**

0 commit comments

Comments
 (0)