Skip to content

fix(symfony): avoid deprecated translation command probe - #8627

Merged
soyuka merged 1 commit into
api-platform:4.4from
tacman:fix/symfony-82-translation-probe
Oct 5, 2026
Merged

soyuka merged 1 commit into
api-platform:4.4from
tacman:fix/symfony-82-translation-probe

Conversation

@tacman

@tacman tacman commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Fixes #8626.

On Symfony 8.2, API Platform's object-mapper feature probe autoloads the deprecated FrameworkBundle TranslationExtractCommand shim. Probe the command's new Translation component namespace first, retaining the old FrameworkBundle class as a short-circuit fallback for earlier Symfony releases. Keep the existing object-mapper availability checks.

The regression test runs in a separate process, loads the real extension, verifies object-mapper metadata registration, and asserts the deprecated class was not loaded. It fails before the fix and passes afterward.

Validation using Symfony 8.2-dev dependencies:

  • The new regression and common-configuration tests pass: 2 tests, 68 assertions.
  • Running the complete extension test class gives 19 passing tests and one existing failure in testSwaggerUiDisabledConfiguration (Swagger UI processor remains registered). That same failure reproduces with the unchanged upstream extension; it is not suppressed or changed here.
  • Both changed PHP files pass syntax checks; git diff --check passes.

@soyuka
soyuka force-pushed the fix/symfony-82-translation-probe branch from dc7ccf1 to eee8978 Compare October 2, 2026 13:55
@soyuka
soyuka changed the base branch from main to 4.4 October 2, 2026 13:55
@soyuka
soyuka merged commit 454262b into api-platform:4.4 Oct 5, 2026
117 checks passed
@soyuka

soyuka commented Oct 5, 2026

Copy link
Copy Markdown
Member

thanks!

soyuka added a commit that referenced this pull request Oct 19, 2026
* fix(symfony): drop translation command probe for object mapper

FrameworkBundle 8.2's TranslationExtractCommand extends a class of the optional symfony/translation
package, so probing it with class_exists() is a fatal error when that package is missing. The probe
only stood for "framework-bundle >= 7.3", which a composer conflict on <7.4 now guarantees, matching
the ^7.4 floor of every other Symfony dependency. Follows up #8627.

Fixes #8725

* test(symfony): guard object mapper gate test like the extension
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.

Symfony 8.2: object mapper feature probe loads deprecated translation command

2 participants