Repository navigation
Fix backend asset initialization on Contao 4.13 - #26
Merged
Merged
Conversation
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.
Contao 4.13 requires a request argument for backend scope matching. Since 3.1.0, the backend assets listener calls it without one, breaking request initialization and console setup/cache warmup.
Inject
RequestStack, return early when there is no current request, and pass the current request explicitly to the scope matcher. Backend asset registration for Turbo navigation remains intact.Add a regression test covering backend, frontend, unscoped and console execution, nested requests in both directions, and repeated initialization. A separate CI matrix runs it against Contao 4.13, 5.3 and 5.7 using isolated framework dependencies.
Restore the existing QA workflow by running PHPStan, Rector and ECS on PHP 8.5, which satisfies the committed development dependency lock file. Remove the empty docblock flagged by ECS. The bundle's PHP requirement stays at ^8.1, and the compatibility matrix continues to test PHP 8.1.
Validation:
ArgumentCountErroron Contao 4.13.58 before the fix.git diff --checkpass.The legacy test fixture permits advisory-blocked Contao 4.13 only within its temporary dependencies, scoped to
contao/core-bundle: ~4.13.0and its requiredenshrined/svg-sanitize: ^0.22andspomky-labs/otphp: ^10.0dependencies, while retaining audit reporting. It never boots an application.Fixes #25