Skip to content

Fix XmlFileLoader fatal error on Symfony 6.4 - #254

Closed
Bullitt300 wants to merge 1 commit into
masterfrom
fix-xmlfileloader-symfony-6.4
Closed

Bullitt300 wants to merge 1 commit into
masterfrom
fix-xmlfileloader-symfony-6.4

Conversation

@Bullitt300

Copy link
Copy Markdown
Contributor

Since 18.2.0 the bundled copy of the Symfony 7 XmlFileLoader is used on every Symfony version. It declares a typed property and calls loadExtensionConfig()/loadExtensionConfigs(), which only exist from Symfony 7.1 on, so every Magento 2.4.7 project (Symfony 6.4) fatals.

The copy is renamed to Symfony7XmlFileLoader. XmlFileLoader now aliases it only if FileLoader::loadExtensionConfigs() exists, otherwise it aliases the XmlFileLoader shipped by Symfony, which disables the alias auto registration as well.

Tested loading symfony/Resources/config/services.xml with symfony/dependency-injection 6.4.49, 7.0.10, 7.4.23 and 8.0.15.

Since 18.2.0 the bundled copy of the Symfony 7 XmlFileLoader is used on
every Symfony version. It declares a typed property and calls
loadExtensionConfig()/loadExtensionConfigs(), which only exist from
Symfony 7.1 on, so every Magento 2.4.7 project (Symfony 6.4) fatals.

The copy is renamed to Symfony7XmlFileLoader. XmlFileLoader now aliases
it only if FileLoader::loadExtensionConfigs() exists, otherwise it
aliases the XmlFileLoader shipped by Symfony, which disables the alias
auto registration as well.

Tested loading symfony/Resources/config/services.xml with
symfony/dependency-injection 6.4.49, 7.0.10, 7.4.23 and 8.0.15.

Co-Authored-By: C.L.A.U.D.I.A. (Claude Opus 5.5) <noreply@anthropic.com>
@svizevv

svizevv commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

The changes have been merged into PR 255.

@svizevv svizevv closed this Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants