Skip to content

Commit 1a69d43

Browse files
author
Aditya Yadav
authored
Changes to support backward compatibility
1 parent 89a5728 commit 1a69d43

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/code/Magento/SalesRule/Model/Rule/DataProvider.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,17 @@ public function __construct(
6262
CollectionFactory $collectionFactory,
6363
\Magento\Framework\Registry $registry,
6464
\Magento\SalesRule\Model\Rule\Metadata\ValueProvider $metadataValueProvider,
65-
DataPersistorInterface $dataPersistor,
65+
DataPersistorInterface $dataPersistor = null,
6666
array $meta = [],
6767
array $data = []
6868
) {
6969
$this->collection = $collectionFactory->create();
7070
$this->coreRegistry = $registry;
7171
$this->metadataValueProvider = $metadataValueProvider;
7272
$meta = array_replace_recursive($this->getMetadataValues(), $meta);
73-
$this->dataPersistor = $dataPersistor;
73+
$this->dataPersistor = $dataPersistor ?? \Magento\Framework\App\ObjectManager::getInstance()->get(
74+
DataPersistorInterface::class
75+
);
7476
parent::__construct($name, $primaryFieldName, $requestFieldName, $meta, $data);
7577
}
7678

0 commit comments

Comments
 (0)