Skip to content

Commit

Permalink
#29174 Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
amenk committed Jul 25, 2020
1 parent 3361e72 commit 79c54ae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/code/Magento/Catalog/Model/CategoryRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

namespace Magento\Catalog\Model;

use Magento\Catalog\Api\Data\CategoryInterface;
use Magento\Framework\Exception\CouldNotSaveException;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\Exception\StateException;
use Magento\Catalog\Api\Data\CategoryInterface;

/**
* Repository for categories.
Expand Down Expand Up @@ -82,7 +82,9 @@ public function save(\Magento\Catalog\Api\Data\CategoryInterface $category)
$existingData = array_diff_key($existingData, array_flip(['path', 'level', 'parent_id']));
$existingData['store_id'] = $storeId;

$existingData = array_replace($existingData, $category->getData());
if (is_array($category->getData())) {
$existingData = array_replace($existingData, $category->getData());
}

if ($category->getId()) {
$metadata = $this->getMetadataPool()->getMetadata(
Expand Down

0 comments on commit 79c54ae

Please sign in to comment.