I am trying to add a filter for RealName that is exposed and allows people to do partial searching of accounts by their realname.
I found that the View was not showing me a field or filter for Realname (Drupal 8.5.x).
Upon inspecting the realname.views.inc file, it looks like it still had older D7 references in it. When I updated the file to this (the join table and id needed updating), I had a filter in my View and it works:
<?php
/**
* @file
* Views integration for the realname module.
*/
/**
* Implements hook_views_data().
*/
function realname_views_data() {
$data['realname']['table']['group'] = t('Realname');
$data['realname']['table']['join'] = [
'users_field_data' => [
'left_field' => 'uid',
'field' => 'uid',
],
];
$data['realname']['realname'] = [
'title' => t('Real name'),
'help' => t("The user's real name."),
'field' => [
'id' => 'standard',
'click sortable' => TRUE,
],
'sort' => [
'id' => 'standard',
],
'argument' => [
'id' => 'string',
],
'filter' => [
'id' => 'string',
'title' => t('Name'),
'help' => t("The user's real name. This filter does not check if the user exists and allows partial matching. Does not utilize autocomplete."),
],
];
return $data;
}
I am not 100% on the sort one, but the rest seem to work.