Skip to content

Commit e95f3f7

Browse files
authored
Make new Json dependency backwards compatible
1 parent 603de52 commit e95f3f7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/code/Magento/Catalog/ViewModel/Product/Breadcrumbs.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
use Magento\Catalog\Helper\Data;
99
use Magento\Framework\App\Config\ScopeConfigInterface;
10+
use Magento\Framework\App\ObjectManager;
1011
use Magento\Framework\DataObject;
1112
use Magento\Framework\Serialize\Serializer\Json;
1213
use Magento\Framework\View\Element\Block\ArgumentInterface;
@@ -41,13 +42,13 @@ class Breadcrumbs extends DataObject implements ArgumentInterface
4142
public function __construct(
4243
Data $catalogData,
4344
ScopeConfigInterface $scopeConfig,
44-
Json $json
45+
Json $json = null
4546
) {
4647
parent::__construct();
4748

4849
$this->catalogData = $catalogData;
4950
$this->scopeConfig = $scopeConfig;
50-
$this->json = $json;
51+
$this->json = $json ?: ObjectManager::getInstance()->get(Json::class);
5152
}
5253

5354
/**

0 commit comments

Comments
 (0)