By longwave on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
10.3.x
Introduced in version:
10.3.0
Issue links:
Description:
Media library openers allow selections to be made from the media library in different contexts (e.g. CKEditor or entity reference field widgets).
Until Drupal 10.2.0, media library opener services only had to implement \Drupal\media_library\MediaLibraryOpenerInterface.
To prepare for changes in Symfony 7, in Drupal 10.3 and above, media library opener services must be explicitly tagged with the media_library.opener tag:
media_library.opener.field_widget:
class: Drupal\media_library\MediaLibraryFieldWidgetOpener
arguments: ['@entity_type.manager']
tags:
- { name: media_library.opener }
Drupal 10.3 also supports autoconfiguration of this tag, so you can enable autoconfiguration for the service:
media_library.opener.field_widget:
class: Drupal\media_library\MediaLibraryFieldWidgetOpener
arguments: ['@entity_type.manager']
autoconfigure: true
You may also choose to autoconfigure all services in a module by adding a _defaults section to services.yml:
services:
_defaults:
autoconfigure: true
Impacts:
Module developers