From 9b930d73c3dc9082d474f432d119eacb15879e1a Mon Sep 17 00:00:00 2001 From: Jan Goralski Date: Fri, 18 Aug 2023 08:39:26 +0200 Subject: [PATCH] [Maintenance] Note deprecation in SelectAttributeChoicesCollectionType --- UPGRADE-1.13.md | 3 +++ .../Configuration/SelectAttributeChoicesCollectionType.php | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/UPGRADE-1.13.md b/UPGRADE-1.13.md index b5a21b9158c..516ec9883c5 100644 --- a/UPGRADE-1.13.md +++ b/UPGRADE-1.13.md @@ -131,3 +131,6 @@ Because of that, the subscribers `Sylius\Bundle\AttributeBundle\Doctrine\ORM\Subscriber\LoadMetadataSubscriber` and `Sylius\Bundle\ReviewBundle\Doctrine\ORM\Subscriber\LoadMetadataSubscriber` have changed so that it does not add a relationship if one already exists. If you have overwritten or decorated it, there may be a need to update it. + +1. Passing an instance of `Sylius\Component\Resource\Translation\Provider\TranslationLocaleProviderInterface` as the first argument + to `Sylius\Bundle\AttributeBundle\Form\Type\AttributeType\Configuration\SelectAttributeChoicesCollectionType` has been deprecated. 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 e5761a58cbe..e5f5442fc5e 100644 --- a/src/Sylius/Bundle/AttributeBundle/Form/Type/AttributeType/Configuration/SelectAttributeChoicesCollectionType.php +++ b/src/Sylius/Bundle/AttributeBundle/Form/Type/AttributeType/Configuration/SelectAttributeChoicesCollectionType.php @@ -28,6 +28,12 @@ class SelectAttributeChoicesCollectionType extends AbstractType public function __construct(?TranslationLocaleProviderInterface $localeProvider = null) { if (null !== $localeProvider) { + @trigger_error(sprintf( + 'Passing an instance of %s as a constructor argument for %s is deprecated as of Sylius 1.13 and will not be possible in 2.0.', + TranslationLocaleProviderInterface::class, + self::class + ), \E_USER_DEPRECATED); + $this->defaultLocaleCode = $localeProvider->getDefaultLocaleCode(); } }