Problem/Motivation

In #3392616-5: Update to Symfony 6.4 we've found out that the Symfony\Component\DependencyInjection\ContainerAwareTrait and Symfony\Component\DependencyInjection\ContainerAwareInterface are being deprecated in Symfony 6.4 and removed in 7.0.

ClassResolver and EntityTypeManager depend on retrieving any arbitrary service from the container, so they still need full access to the container.

Steps to reproduce

Proposed resolution

Inject service_container as an argument instead of making them ContainerAware, based on work by @Spokje in #3397522: Fork Symfony's ContainerAwareTrait and ContainerAwareInterface into core

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3419909

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

longwave created an issue. See original summary.

longwave credited Spokje.

longwave’s picture

Status: Active » Needs review

Cherry-picked the relevant commits from @Spokje's work and fixed conflicts.

spokje’s picture

I like this, but hey, I boilerplated/wrote most of it, so I'm probably not the right one to RTBC this...

To make this comment some kinda useful, I've created a CR and updated the MR to point to it.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @Spokje the CR helped!

  • catch committed 05134017 on 11.x
    Issue #3419909 by longwave, Spokje: Explicitly inject the container into...
spokje’s picture

@catch You might have missed putting this on Fixed after the commit?

catch’s picture

Status: Reviewed & tested by the community » Fixed

Oops yes. Marking fixed!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.