File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
app/code/Magento/Theme/Block/Adminhtml/Wysiwyg/Files Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -22,20 +22,30 @@ class Tree extends \Magento\Backend\Block\Template
22
22
*/
23
23
protected $ urlEncoder ;
24
24
25
+ /**
26
+ * @var \Magento\Framework\Serialize\Serializer\Json
27
+ */
28
+ private $ serializer ;
29
+
25
30
/**
26
31
* @param \Magento\Backend\Block\Template\Context $context
27
32
* @param \Magento\Theme\Helper\Storage $storageHelper
28
33
* @param \Magento\Framework\Url\EncoderInterface $urlEncoder
29
34
* @param array $data
35
+ * @param \Magento\Framework\Serialize\Serializer\Json|null $serializer
36
+ * @throws \RuntimeException
30
37
*/
31
38
public function __construct (
32
39
\Magento \Backend \Block \Template \Context $ context ,
33
40
\Magento \Theme \Helper \Storage $ storageHelper ,
34
41
\Magento \Framework \Url \EncoderInterface $ urlEncoder ,
35
- array $ data = []
42
+ array $ data = [],
43
+ \Magento \Framework \Serialize \Serializer \Json $ serializer = null
36
44
) {
37
45
$ this ->_storageHelper = $ storageHelper ;
38
46
$ this ->urlEncoder = $ urlEncoder ;
47
+ $ this ->serializer = $ serializer ?: \Magento \Framework \App \ObjectManager::getInstance ()
48
+ ->get (\Magento \Framework \Serialize \Serializer \Json::class);
39
49
parent ::__construct ($ context , $ data );
40
50
}
41
51
@@ -57,7 +67,7 @@ public function getTreeLoaderUrl()
57
67
*/
58
68
public function getTreeJson ($ data )
59
69
{
60
- return \Zend_Json:: encode ($ data );
70
+ return $ this -> serializer -> serialize ($ data );
61
71
}
62
72
63
73
/**
You can’t perform that action at this time.
0 commit comments