Add 4.39 recipe for sonata-project/admin-bundle with PHP routing - #1993
Merged
symfony-recipes-bot merged 1 commit intoJun 3, 2026
Merged
Conversation
Symfony 8.0 removed XmlFileLoader support for routing (deprecated in 7.4). The PHP routing file sonata_admin.php was introduced in SonataAdminBundle 4.39, so a new recipe version is required rather than modifying the existing 4.0 recipe. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
symfony-recipes-bot
enabled auto-merge (squash)
June 3, 2026 13:59
Collaborator
|
Thanks for the PR 😍 How to test these changes in your application
Diff between recipe versionsIn order to help with the review stage, I'm in charge of computing the diff between the various versions of patched recipes. sonata-project/admin-bundle3.31 vs 3.64diff --git a/sonata-project/admin-bundle/3.31/config/packages/sonata_admin.yaml b/sonata-project/admin-bundle/3.64/config/packages/sonata_admin.yaml
index 28f4f348..7e3ca920 100644
--- a/sonata-project/admin-bundle/3.31/config/packages/sonata_admin.yaml
+++ b/sonata-project/admin-bundle/3.64/config/packages/sonata_admin.yaml
@@ -3,6 +3,8 @@ sonata_admin:
dashboard:
blocks:
- { type: sonata.admin.block.admin_list, position: left }
+ options:
+ legacy_twig_text_extension: false
sonata_block:
blocks:3.64 vs 4.0diff --git a/sonata-project/admin-bundle/3.64/config/packages/sonata_admin.yaml b/sonata-project/admin-bundle/4.0/config/packages/sonata_admin.yaml
index 7e3ca920..28f4f348 100644
--- a/sonata-project/admin-bundle/3.64/config/packages/sonata_admin.yaml
+++ b/sonata-project/admin-bundle/4.0/config/packages/sonata_admin.yaml
@@ -3,8 +3,6 @@ sonata_admin:
dashboard:
blocks:
- { type: sonata.admin.block.admin_list, position: left }
- options:
- legacy_twig_text_extension: false
sonata_block:
blocks:4.0 vs 4.39diff --git a/sonata-project/admin-bundle/4.0/config/routes/sonata_admin.yaml b/sonata-project/admin-bundle/4.39/config/routes/sonata_admin.yaml
index c009e3bf..8bf4a649 100644
--- a/sonata-project/admin-bundle/4.0/config/routes/sonata_admin.yaml
+++ b/sonata-project/admin-bundle/4.39/config/routes/sonata_admin.yaml
@@ -1,5 +1,6 @@
admin_area:
- resource: "@SonataAdminBundle/Resources/config/routing/sonata_admin.xml"
+ resource: "@SonataAdminBundle/Resources/config/routing/sonata_admin.php"
+ type: php
prefix: /admin
_sonata_admin: |
diimpp
approved these changes
Jun 3, 2026
| @@ -0,0 +1,9 @@ | |||
| admin_area: | |||
| resource: "@SonataAdminBundle/Resources/config/routing/sonata_admin.php" | |||
| type: php | |||
Member
There was a problem hiding this comment.
I don't think type is necessary for it to work.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
sonata_admin.xmlrouting is broken in Symfony 8.0, which removedXmlFileLoadersupport for routing (it was deprecated in 7.4). This causes:See: sonata-project/SonataAdminBundle#8374
Why a new recipe version instead of editing 4.0
The PHP routing file
sonata_admin.phpwas introduced in SonataAdminBundle 4.39.0. Modifying the4.0recipe to reference it would break installations running older versions (as noted in the review on PR #1989).Solution
Add a new
4.39recipe version that referencessonata_admin.phpwithtype: php, leaving the4.0recipe untouched for older installs.This supersedes PR #1989 which addressed the same issue but modified the
4.0recipe directly.