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
+ use Magento \Framework \Serialize \Serializer \Json ;
10
+
8
11
/**
9
12
* Adminhtml media library uploader
10
13
* @api
@@ -27,17 +30,25 @@ class Uploader extends \Magento\Backend\Block\Widget
27
30
*/
28
31
protected $ _fileSizeService ;
29
32
33
+ /**
34
+ * @var Json
35
+ */
36
+ private $ jsonEncoder ;
37
+
30
38
/**
31
39
* @param \Magento\Backend\Block\Template\Context $context
32
40
* @param \Magento\Framework\File\Size $fileSize
33
41
* @param array $data
42
+ * @param Json $jsonEncoder
34
43
*/
35
44
public function __construct (
36
45
\Magento \Backend \Block \Template \Context $ context ,
37
46
\Magento \Framework \File \Size $ fileSize ,
38
- array $ data = []
47
+ array $ data = [],
48
+ Json $ jsonEncoder = null
39
49
) {
40
50
$ this ->_fileSizeService = $ fileSize ;
51
+ $ this ->jsonEncoder = $ jsonEncoder ?: ObjectManager::getInstance ()->get (Json::class);
41
52
parent ::__construct ($ context , $ data );
42
53
}
43
54
@@ -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