Skip to content

Commit

Permalink
Prevent endless loop when duplicating product
Browse files Browse the repository at this point in the history
Remove redundant backward compatibility in constructor
  • Loading branch information
ihor-sviziev authored Feb 4, 2020
1 parent 8e2959d commit a027e87
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/code/Magento/Catalog/Model/Product/Copier.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ public function __construct(
CopyConstructorInterface $copyConstructor,
ProductFactory $productFactory,
ScopeOverriddenValue $scopeOverriddenValue,
OptionRepository $optionRepository = null,
MetadataPool $metadataPool = null
OptionRepository $optionRepository,
MetadataPool $metadataPool
) {
$this->productFactory = $productFactory;
$this->copyConstructor = $copyConstructor;
$this->scopeOverriddenValue = $scopeOverriddenValue;
$this->optionRepository = $optionRepository ?: ObjectManager::getInstance()->get(OptionRepository::class);
$this->metadataPool = $metadataPool ?: ObjectManager::getInstance()->get(MetadataPool::class);
$this->optionRepository = $optionRepository;
$this->metadataPool = $metadataPool;
}

/**
Expand Down

0 comments on commit a027e87

Please sign in to comment.