From ec4d4d890fbd85410cced67e9a2ca81875e4f624 Mon Sep 17 00:00:00 2001 From: TheMilek Date: Thu, 10 Aug 2023 10:04:24 +0200 Subject: [PATCH] Remove usage of defaultLocaleCode from SelectAttributeChoicesCollectionType --- .../SelectAttributeChoicesCollectionType.php | 12 ------------ .../Resources/config/services/attribute_types.xml | 1 - 2 files changed, 13 deletions(-) diff --git a/src/Sylius/Bundle/AttributeBundle/Form/Type/AttributeType/Configuration/SelectAttributeChoicesCollectionType.php b/src/Sylius/Bundle/AttributeBundle/Form/Type/AttributeType/Configuration/SelectAttributeChoicesCollectionType.php index df4f5977d4..c046c32866 100644 --- a/src/Sylius/Bundle/AttributeBundle/Form/Type/AttributeType/Configuration/SelectAttributeChoicesCollectionType.php +++ b/src/Sylius/Bundle/AttributeBundle/Form/Type/AttributeType/Configuration/SelectAttributeChoicesCollectionType.php @@ -14,7 +14,6 @@ declare(strict_types=1); namespace Sylius\Bundle\AttributeBundle\Form\Type\AttributeType\Configuration; use Ramsey\Uuid\Uuid; -use Sylius\Component\Resource\Translation\Provider\TranslationLocaleProviderInterface; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\CollectionType; use Symfony\Component\Form\FormBuilderInterface; @@ -23,13 +22,6 @@ use Symfony\Component\Form\FormEvents; class SelectAttributeChoicesCollectionType extends AbstractType { - private string $defaultLocaleCode; - - public function __construct(TranslationLocaleProviderInterface $localeProvider) - { - $this->defaultLocaleCode = $localeProvider->getDefaultLocaleCode(); - } - /** * @psalm-suppress InvalidScalarArgument Some weird magic going on here, not sure about refactor */ @@ -48,10 +40,6 @@ class SelectAttributeChoicesCollectionType extends AbstractType continue; } - if (!array_key_exists($this->defaultLocaleCode, $values)) { - continue; - } - $key = (string) $key; $newKey = $this->getUniqueKey(); $fixedData[$newKey] = $this->resolveValues($values); diff --git a/src/Sylius/Bundle/AttributeBundle/Resources/config/services/attribute_types.xml b/src/Sylius/Bundle/AttributeBundle/Resources/config/services/attribute_types.xml index 5778bc3811..ff08a924ae 100644 --- a/src/Sylius/Bundle/AttributeBundle/Resources/config/services/attribute_types.xml +++ b/src/Sylius/Bundle/AttributeBundle/Resources/config/services/attribute_types.xml @@ -65,7 +65,6 @@ -