From 157b61334f0a27270c903d3573eb6cf673da4a45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Tue, 18 Mar 2025 17:29:14 +0100 Subject: [PATCH 1/2] [FrameworkBundle] Exclude ORM attributes only when not already done by DoctrineBundle --- .../FrameworkExtension.php | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 9ee0f0f43441..a9c0c8d548a0 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -771,15 +771,19 @@ static function (ChildDefinition $definition, AsPeriodicTask|AsCronTask $attribu $container->registerAttributeForAutoconfiguration(AsMessage::class, static function (ChildDefinition $definition) { $definition->addExcludeTag('container.excluded.messenger.message'); }); - $container->registerAttributeForAutoconfiguration(Entity::class, static function (ChildDefinition $definition) { - $definition->addExcludeTag('container.excluded.doctrine.entity'); - }); - $container->registerAttributeForAutoconfiguration(Embeddable::class, static function (ChildDefinition $definition) { - $definition->addExcludeTag('container.excluded.doctrine.embeddable'); - }); - $container->registerAttributeForAutoconfiguration(MappedSuperclass::class, static function (ChildDefinition $definition) { - $definition->addExcludeTag('container.excluded.doctrine.mapped_superclass'); - }); + + // DoctrineBundle autoconfigures attributes since version 2.14.0 + if (!array_key_exists(Entity::class, $container->getAutoconfiguredAttributes())) { + $container->registerAttributeForAutoconfiguration(Entity::class, static function (ChildDefinition $definition) { + $definition->addExcludeTag('container.excluded.doctrine.entity'); + }); + $container->registerAttributeForAutoconfiguration(Embeddable::class, static function (ChildDefinition $definition) { + $definition->addExcludeTag('container.excluded.doctrine.embeddable'); + }); + $container->registerAttributeForAutoconfiguration(MappedSuperclass::class, static function (ChildDefinition $definition) { + $definition->addExcludeTag('container.excluded.doctrine.mapped_superclass'); + }); + } $container->registerAttributeForAutoconfiguration(JsonStreamable::class, static function (ChildDefinition $definition, JsonStreamable $attribute) { $definition->addExcludeTag('json_streamer.streamable', [ From 32c994c81e2bfd4c9a05fc40bb76d5752cdc5ff7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Tamarelle?= Date: Tue, 18 Mar 2025 17:42:49 +0100 Subject: [PATCH 2/2] ChildDefinition::addExcludeTag was added in version 7.3 --- src/Symfony/Bundle/FrameworkBundle/composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/composer.json b/src/Symfony/Bundle/FrameworkBundle/composer.json index 72d33ed884df..6e4656b9d6e4 100644 --- a/src/Symfony/Bundle/FrameworkBundle/composer.json +++ b/src/Symfony/Bundle/FrameworkBundle/composer.json @@ -21,7 +21,7 @@ "ext-xml": "*", "symfony/cache": "^6.4|^7.0", "symfony/config": "^7.3", - "symfony/dependency-injection": "^7.2", + "symfony/dependency-injection": "^7.3", "symfony/deprecation-contracts": "^2.5|^3", "symfony/error-handler": "^7.3", "symfony/event-dispatcher": "^6.4|^7.0", pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy