Skip to content

Commit

Permalink
fix: Prevent attribute duplication
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoya-de committed Oct 12, 2023
1 parent a436ce1 commit fab1c81
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
use Makaira\OxidConnectEssential\Type\Product\Product;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;

use function array_unique;
use function array_values;
use function get_object_vars;

/**
Expand Down Expand Up @@ -211,6 +213,11 @@ public function getChangesFromList(array $result, int $since, int $limit = 50):
(array) $this->parentAttributes[$parentId]['attributeFloat'],
$change->data->attributeFloat
);

$change->data->attributeStr = array_values(array_unique($change->data->attributeStr));
$change->data->attributeInt = array_values(array_unique($change->data->attributeInt));
$change->data->attributeFloat = array_values(array_unique($change->data->attributeFloat));

unset(
$change->data->tmpAttributeStr,
$change->data->tmpAttributeInt,
Expand Down

0 comments on commit fab1c81

Please sign in to comment.