Adding media library openers use autoconfigure and tags in 10.3.x has BC consequences

Created on 8 May 2024, about 2 months ago
Updated 25 June 2024, 5 days ago

Problem/Motivation

The contrib module Media Library Media Modify was overriding the media_library.opener.field_widget by having

  media_library.opener.field_widget:
    class: Drupal\media_library_media_modify\MediaLibraryMediaModifyFieldWidgetOpener
    arguments: [ '@entity_type.manager' ]

in its services.yml file. This would replace the media_library's service definition. And this works in 10.2.x but fails on 10.3.x due to the changes in πŸ“Œ Add default autoconfigure to all *.services.yml and remove event_subscriber tags Fixed and πŸ“Œ Convert OpenerResolver to use a service locator Fixed .

Steps to reproduce

Run Thunder's tests on 10.3.x

Proposed resolution

Note the module will be fixed in πŸ› Use service decoration to replace media_library.opener.field_widget Needs review but there are other modules that might be affected - see http://codcontrib.hank.vps-private.net/search?text=MediaLibraryOpenerInt...

In discussion with @longwave, we decided that the issue occurs because we added a new tag (media_library.opener) and enabled autoconfig for it. We could add a BC layer by extending service_collector to also look for interfaces (and issue a deprecation if a service has the interface but is not tagged).

It is also apparent that https://www.drupal.org/project/drupal/issues/3421480 πŸ“Œ Convert OpenerResolver to use a service locator Fixed is missing a change record.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Active

Version

10.3 ✨

Component
MediaΒ  β†’

Last updated 2 days ago

Created by

πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

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

Comments & Activities

Production build 0.69.0 2024