Skip to content

Symfony 8.2: object mapper feature probe loads deprecated translation command #8626

Closed

Description

@tacman

With API Platform 5.0.1 and Symfony 8.2-dev, compiling the application emits a deprecation for Symfony\Bundle\FrameworkBundle\Command\TranslationExtractCommand.

ApiPlatformExtension uses class_exists(TranslationExtractCommand::class) as part of its object-mapper availability gate. Symfony 8.2 moved this command into Symfony\Component\Translation\Command; probing the FrameworkBundle compatibility class autoloads its deprecation even though the command is not used.

Reproduce by installing symfony/object-mapper alongside Symfony 8.2-dev and API Platform, clearing the application cache, and running debug:container --deprecations.

A regression test loading the extension with the new command available confirms that the legacy command is loaded before the fix. Checking the new namespace first, with the existing class as a fallback for older Symfony versions, avoids the warning while retaining object-mapper configuration.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions