From 9c73e23ce264401116dfb429ac59e81e105c6f25 Mon Sep 17 00:00:00 2001 From: Tobias Feijten Date: Tue, 17 Feb 2026 20:46:27 +0100 Subject: [PATCH] Implement setting data retrieved from TranslationsFormsType back to FormType --- src/Form/Type/TranslationsFormsType.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Form/Type/TranslationsFormsType.php b/src/Form/Type/TranslationsFormsType.php index 4347274..c627fdf 100644 --- a/src/Form/Type/TranslationsFormsType.php +++ b/src/Form/Type/TranslationsFormsType.php @@ -74,6 +74,10 @@ public function buildForm(FormBuilderInterface $builder, array $options): void $translation->locale = $locale; // @phpstan-ignore property.notFound $translationColl->add($translation); }, + 'getter' => static function (Collection $translationColl, FormInterface $form) use ($locale): ?OneLocaleInterface { + /** @var Collection $translationColl */ + return $translationColl->findFirst(static fn (int|string $_key, OneLocaleInterface $translation): bool => $translation->locale === $locale); // @phpstan-ignore property.notFound + }, // LocaleExtension options process 'label' => $options['locale_labels'][$locale] ?? null, 'required' => \in_array($locale, $options['required_locales'], true),