Skip to content

Commit 5d42cef

Browse files
committed
Update the Adminhtml image tree to use the new Serializer Json rather than Zend_Json
1 parent 2e53cf0 commit 5d42cef

File tree

1 file changed

+12
-2
lines changed
  • app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images

1 file changed

+12
-2
lines changed

app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Tree.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,30 @@ class Tree extends \Magento\Backend\Block\Template
2626
*/
2727
protected $_cmsWysiwygImages = null;
2828

29+
/**
30+
* @var \Magento\Framework\Serialize\Serializer\Json
31+
*/
32+
private $serializer;
33+
2934
/**
3035
* @param \Magento\Backend\Block\Template\Context $context
3136
* @param \Magento\Cms\Helper\Wysiwyg\Images $cmsWysiwygImages
3237
* @param \Magento\Framework\Registry $registry
3338
* @param array $data
39+
* @param \Magento\Framework\Serialize\Serializer\Json|null $serializer
40+
* @throws \RuntimeException
3441
*/
3542
public function __construct(
3643
\Magento\Backend\Block\Template\Context $context,
3744
\Magento\Cms\Helper\Wysiwyg\Images $cmsWysiwygImages,
3845
\Magento\Framework\Registry $registry,
39-
array $data = []
46+
array $data = [],
47+
\Magento\Framework\Serialize\Serializer\Json $serializer = null
4048
) {
4149
$this->_coreRegistry = $registry;
4250
$this->_cmsWysiwygImages = $cmsWysiwygImages;
51+
$this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance()
52+
->get(\Magento\Framework\Serialize\Serializer\Json::class);
4353
parent::__construct($context, $data);
4454
}
4555

@@ -65,7 +75,7 @@ public function getTreeJson()
6575
'cls' => 'folder',
6676
];
6777
}
68-
return \Zend_Json::encode($jsonArray);
78+
return $this->serializer->serialize($jsonArray);
6979
}
7080

7181
/**

0 commit comments

Comments
 (0)