File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
app/code/Magento/Backend/Block/Media Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 5
5
*/
6
6
namespace Magento \Backend \Block \Media ;
7
7
8
+ use Magento \Framework \App \ObjectManager ;
9
+
8
10
/**
9
11
* Adminhtml media library uploader
10
12
* @api
@@ -27,16 +29,25 @@ class Uploader extends \Magento\Backend\Block\Widget
27
29
*/
28
30
protected $ _fileSizeService ;
29
31
32
+ /**
33
+ * @var \Magento\Framework\Json\EncoderInterface
34
+ */
35
+ protected $ _jsonEncoder ;
36
+
30
37
/**
31
38
* @param \Magento\Backend\Block\Template\Context $context
32
39
* @param \Magento\Framework\File\Size $fileSize
33
40
* @param array $data
41
+ * @param \Magento\Framework\Json\EncoderInterface $jsonEncoder
34
42
*/
35
43
public function __construct (
36
44
\Magento \Backend \Block \Template \Context $ context ,
37
45
\Magento \Framework \File \Size $ fileSize ,
38
- array $ data = []
46
+ array $ data = [],
47
+ \Magento \Framework \Json \EncoderInterface $ jsonEncoder = null
39
48
) {
49
+ $ this ->_jsonEncoder = $ jsonEncoder ?:
50
+ ObjectManager::getInstance ()->get (\Magento \Framework \Json \EncoderInterface::class);
40
51
$ this ->_fileSizeService = $ fileSize ;
41
52
parent ::__construct ($ context , $ data );
42
53
}
@@ -107,7 +118,7 @@ public function getJsObjectName()
107
118
*/
108
119
public function getConfigJson ()
109
120
{
110
- return $ this ->_coreData -> jsonEncode ($ this ->getConfig ()->getData ());
121
+ return $ this ->_jsonEncoder -> encode ($ this ->getConfig ()->getData ());
111
122
}
112
123
113
124
/**
You can’t perform that action at this time.
0 commit comments