Skip to content

Fix backend asset initialization on Contao 4.13 - #26

Merged
koertho merged 6 commits into
v3from
fix/25-contao-413-backend-assets
Nov 4, 2026
Merged

koertho merged 6 commits into
v3from
fix/25-contao-413-backend-assets

Conversation

@koertho

@koertho koertho commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • Reproduced the original ArgumentCountError on Contao 4.13.58 before the fix.
  • All six regression cases pass with real Contao 4.13, 5.3 and 5.7 dependencies in local containers.
  • Full PHPStan, Rector dry run and ECS checks pass locally on PHP 8.5 and in GitHub CI.
  • Final GitHub compatibility matrix passes on Contao 4.13 / PHP 8.1, Contao 5.3 / PHP 8.1 and Contao 5.7 / PHP 8.3.
  • PHP syntax, workflow YAML lint and git diff --check pass.
  • Composer validates the manifest but reports an already outdated lock file; dependency files are unchanged.
  • No database access or changes. Full application cache warmup and browser flows were not run.

The legacy test fixture permits advisory-blocked Contao 4.13 only within its temporary dependencies, scoped to contao/core-bundle: ~4.13.0 and its required enshrined/svg-sanitize: ^0.22 and spomky-labs/otphp: ^10.0 dependencies, while retaining audit reporting. It never boots an application.

Fixes #25

@koertho
koertho merged commit 45ba082 into v3 Nov 4, 2026
9 checks passed
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.

3.1.0: BackendAssetsListener bricht unter Contao 4.13 ab – isBackendRequest() ohne Request aufgerufen

1 participant