Convert OpenerResolver to use a service locator

Created on 14 February 2024, 10 months ago
Updated 16 July 2024, 5 months ago

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.

\Drupal\media_library\OpenerResolver is ContainerAware. It exists only to ensure that service names stored in MediaLibraryState are instances of MediaLibraryOpenerInterface and are retrievable from the container.

Steps to reproduce

Proposed resolution

  • Use autoconfiguration to tag MediaLibraryOpenerInterface services
  • Use a service collector to inject MediaLibraryOpenerInterface services directly into MediaLibraryUiBuilder and select the correct one by ID at runtime
  • - it's internal

OpenerResolver is tagged @internal so I think this is OK to do in 10.x for removal in 11.x with no replacement.

Remaining tasks

Add a change record

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Fixed

Version

10.3 ✨

Component
MediaΒ  β†’

Last updated 1 day ago

Created by

πŸ‡¬πŸ‡§United Kingdom longwave UK

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024