Skip to content

Commit a027e87

Browse files
authored
Prevent endless loop when duplicating product
Remove redundant backward compatibility in constructor
1 parent 8e2959d commit a027e87

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/code/Magento/Catalog/Model/Product/Copier.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ public function __construct(
5959
CopyConstructorInterface $copyConstructor,
6060
ProductFactory $productFactory,
6161
ScopeOverriddenValue $scopeOverriddenValue,
62-
OptionRepository $optionRepository = null,
63-
MetadataPool $metadataPool = null
62+
OptionRepository $optionRepository,
63+
MetadataPool $metadataPool
6464
) {
6565
$this->productFactory = $productFactory;
6666
$this->copyConstructor = $copyConstructor;
6767
$this->scopeOverriddenValue = $scopeOverriddenValue;
68-
$this->optionRepository = $optionRepository ?: ObjectManager::getInstance()->get(OptionRepository::class);
69-
$this->metadataPool = $metadataPool ?: ObjectManager::getInstance()->get(MetadataPool::class);
68+
$this->optionRepository = $optionRepository;
69+
$this->metadataPool = $metadataPool;
7070
}
7171

7272
/**

0 commit comments

Comments
 (0)