Grouped filter combobox only contains "Any"

Created on 26 March 2023, over 1 year ago

Problem/Motivation

When I use a relationship, grouped filters combobox appears only with Any item

Steps to reproduce

My SQLite database contains three tables with some fields:

- books
  -id:      integer and unique key

- books_authors_link
  -id:      integer and unique key
  -book:    integer
  -author:  integer
  
-authors:
  -id:      integer and unique key
  -name:    text
  

I have a custom module with the views_data_alter function with this content:

$data['books']['books_authors_link_table'] = [
    'title' => t('Books Authors link'),
    'relationship' => [
      'base' => 'books_authors_link',
      'base field' => 'book',
      'field' => 'id',
      'id' => 'views_database_connector_relationship',
      'label' => t('Books authors link'),
    ],
  ];
  
  $data['books_authors_link']['authors_table'] = [
    'title' => t('Author link'),
    'relationship' => [
      'base' => 'authors',
      'base field' => 'id',
      'field' => 'author',
      'id' => 'views_database_connector_relationship',
      'label' => t('Author link'),
    ],
  ];

I can use the field "name" from the authors table and filter the results by the author name even with a single exposed filter

However, if I want filter with a grouped exposed filter only the value "Any" appears in the combobox filter.

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇪🇸Spain carlos espino Guatiza (Lanzarote)

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

Comments & Activities

Production build 0.71.5 2024