Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293104

Media author views filter should use the user_name plugin

$
0
0

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';

  1. Create a new filter plugin for the Author filter

How to test

  1. Enable the media module.
  2. Create a view for media content.
  3. Add a media author filter to a view and make it an exposed filter.
  4. Notice it's a simple text field and takes the uid as a value.
  5. Remove the filter and apply the patch, clearing caches just to be sure.
  6. 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.


Viewing all articles
Browse latest Browse all 293104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>