Problem/Motivation
The media Authored by filter should use the user_name filter plugin OOTB in order to be consistent with Content, and provide a better UX with an autocomplete field.
Proposed resolution
Add this one liner to MediaViewsData
$data['media_field_data']['uid']['filter']['id'] = 'user_name';
- Create a new filter plugin for the Author filter
How to test
- Enable the media module.
- Create a view for media content.
- Add a media author filter to a view and make it an exposed filter.
- Notice it's a simple text field and takes the uid as a value.
- Remove the filter and apply the patch, clearing caches just to be sure.
- Add the new "Author name" filter, notice it's now an autocomplete field taking usernames as the values.
Remaining tasks
- Needs review
User interface changes
- N/A.
- Just new filter plugin will be avilable
API changes
- N/A
Data model changes
- N/A
Release notes snippet
- We now have an additional filter plugin for the media entity view.
- This plugin allows to filter the media items based on the author of media.