Skip to content

Commit

Permalink
Update the Adminhtml image tree to use the new Serializer Json rather…
Browse files Browse the repository at this point in the history
… than Zend_Json
  • Loading branch information
dmanners committed Feb 10, 2017
1 parent 2e53cf0 commit 5d42cef
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Tree.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,30 @@ class Tree extends \Magento\Backend\Block\Template
*/
protected $_cmsWysiwygImages = null;

/**
* @var \Magento\Framework\Serialize\Serializer\Json
*/
private $serializer;

/**
* @param \Magento\Backend\Block\Template\Context $context
* @param \Magento\Cms\Helper\Wysiwyg\Images $cmsWysiwygImages
* @param \Magento\Framework\Registry $registry
* @param array $data
* @param \Magento\Framework\Serialize\Serializer\Json|null $serializer
* @throws \RuntimeException
*/
public function __construct(
\Magento\Backend\Block\Template\Context $context,
\Magento\Cms\Helper\Wysiwyg\Images $cmsWysiwygImages,
\Magento\Framework\Registry $registry,
array $data = []
array $data = [],
\Magento\Framework\Serialize\Serializer\Json $serializer = null
) {
$this->_coreRegistry = $registry;
$this->_cmsWysiwygImages = $cmsWysiwygImages;
$this->serializer = $serializer ?: \Magento\Framework\App\ObjectManager::getInstance()
->get(\Magento\Framework\Serialize\Serializer\Json::class);
parent::__construct($context, $data);
}

Expand All @@ -65,7 +75,7 @@ public function getTreeJson()
'cls' => 'folder',
];
}
return \Zend_Json::encode($jsonArray);
return $this->serializer->serialize($jsonArray);
}

/**
Expand Down

0 comments on commit 5d42cef

Please sign in to comment.