Skip to content

Commit

Permalink
Make new Json dependency backwards compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
tdgroot authored and gelanivishal committed Jun 30, 2018
1 parent ce39035 commit 35ce945
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

use Magento\Catalog\Helper\Data;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\DataObject;
use Magento\Framework\Serialize\Serializer\Json;
use Magento\Framework\View\Element\Block\ArgumentInterface;
Expand Down Expand Up @@ -43,13 +44,13 @@ class Breadcrumbs extends DataObject implements ArgumentInterface
public function __construct(
Data $catalogData,
ScopeConfigInterface $scopeConfig,
Json $json
Json $json = null
) {
parent::__construct();

$this->catalogData = $catalogData;
$this->scopeConfig = $scopeConfig;
$this->json = $json;
$this->json = $json ?: ObjectManager::getInstance()->get(Json::class);
}

/**
Expand Down

0 comments on commit 35ce945

Please sign in to comment.