diff --git a/ajax/categories/getFields.php b/ajax/categories/getFields.php index c7482c0bbdff2c458b76c573b5afb15cbd1feda3..257b0c435885f65bf1ac5a57c7997b4ecd07ebc6 100644 --- a/ajax/categories/getFields.php +++ b/ajax/categories/getFields.php @@ -33,9 +33,13 @@ function ($categoryIds) { // cleanup /* @var $Field QUI\ERP\Products\Field\Field */ + $isset = []; + foreach ($fields as $Field) { - if (!isset($results[$Field->getId()])) { + if (!isset($isset[$Field->getId()])) { $result[] = $Field->getAttributes(); + + $isset[$Field->getId()] = true; } } diff --git a/src/QUI/ERP/Products/Utils/Search.php b/src/QUI/ERP/Products/Utils/Search.php index f4d7971a73eb9da90531f77f122164a90e3a91ff..dbc49065440d663a5e8a74b99c185e10f6c86d1f 100644 --- a/src/QUI/ERP/Products/Utils/Search.php +++ b/src/QUI/ERP/Products/Utils/Search.php @@ -146,6 +146,7 @@ public static function getDefaultFrontendFields() if ($defaultIds) { $defaultIds = \explode(',', $defaultIds); + $defaultIds = \array_unique($defaultIds); foreach ($defaultIds as $fieldId) { try { @@ -178,6 +179,7 @@ public static function getDefaultFrontendFreeTextFields() if ($defaultIds) { $defaultIds = \explode(',', $defaultIds); + $defaultIds = \array_unique($defaultIds); foreach ($defaultIds as $fieldId) { try {