From a2a65ead1201b1a06279bacce839010f36fd9398 Mon Sep 17 00:00:00 2001 From: David Date: Wed, 5 Jun 2024 10:44:22 +0200 Subject: [PATCH 1/2] added included_fields option to TranslationsType Signed-off-by: David --- composer.json | 3 +++ src/Form/EventListener/TranslationsListener.php | 1 + src/Form/Type/TranslationsType.php | 1 + 3 files changed, 5 insertions(+) diff --git a/composer.json b/composer.json index 156fb52..25e2883 100644 --- a/composer.json +++ b/composer.json @@ -37,6 +37,9 @@ "symfony/http-kernel": "^5.4.30|^6.3|^7.0", "symfony/options-resolver": "^5.4.30|^6.3|^7.0" }, + "conflict": { + "a2lix/auto-form-bundle": "<0.4.8" + }, "require-dev": { "doctrine/orm": "^2.15", "friendsofphp/php-cs-fixer": "^3.45", diff --git a/src/Form/EventListener/TranslationsListener.php b/src/Form/EventListener/TranslationsListener.php index d200f6e..2b56e62 100644 --- a/src/Form/EventListener/TranslationsListener.php +++ b/src/Form/EventListener/TranslationsListener.php @@ -58,6 +58,7 @@ public function preSetData(FormEvent $event): void 'block_name' => ('field' === $formOptions['theming_granularity']) ? 'locale' : null, 'fields' => $fieldsOptions[$locale], 'excluded_fields' => $formOptions['excluded_fields'], + 'included_fields' => $formOptions['included_fields'], ]); } } diff --git a/src/Form/Type/TranslationsType.php b/src/Form/Type/TranslationsType.php index 4794acf..3d9ed8e 100644 --- a/src/Form/Type/TranslationsType.php +++ b/src/Form/Type/TranslationsType.php @@ -52,6 +52,7 @@ public function configureOptions(OptionsResolver $resolver): void 'theming_granularity' => 'field', 'fields' => [], 'excluded_fields' => [], + 'included_fields' => [], ]); $resolver->setAllowedValues('theming_granularity', ['field', 'locale_field']); From 7236eca370ddfba71590390a21053be85134aab7 Mon Sep 17 00:00:00 2001 From: David Date: Thu, 7 Nov 2024 12:49:59 +0100 Subject: [PATCH 2/2] fix deprecation for di Extension --- src/DependencyInjection/A2lixTranslationFormExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DependencyInjection/A2lixTranslationFormExtension.php b/src/DependencyInjection/A2lixTranslationFormExtension.php index affd5ac..2f618f1 100644 --- a/src/DependencyInjection/A2lixTranslationFormExtension.php +++ b/src/DependencyInjection/A2lixTranslationFormExtension.php @@ -16,8 +16,8 @@ use Symfony\Component\Config\Definition\Processor; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; +use Symfony\Component\DependencyInjection\Extension\Extension; use Symfony\Component\DependencyInjection\Loader\XmlFileLoader; -use Symfony\Component\HttpKernel\DependencyInjection\Extension; class A2lixTranslationFormExtension extends Extension {