View filter doesn't work

Created on 17 January 2021, over 3 years ago
Updated 25 January 2023, over 1 year ago

Problem/Motivation

I may be using the filter wrong but through my tests I fell on two separate issues ;

  • Selecting a term through a select list :
    • Works properly in the view query, the machine name is properly set as a query condition.
    • Once the filter is saved, the option display "Unknown" as the selected value.
    • The view can't be saved as an error prevent this to happen : "No valid values found on filter: @filter." coming from InOperator:validate().
  • Selecting a term through an autocomplete field:
    • The condition is not properly set as it's still a tid that is set.
    • Fatal error when trying to save the view.

Steps to reproduce

  1. Enable the module and create a bunch of test taxonomy terms.
  2. Create a taxonomy term view.
  3. Add a machine name filtering field.
  4. Save the view.

Proposed resolution

From what I see the adminSummary() method tries to load a term based on its id, where it should now try to load it through its machine name properties.
The whole logic behind the autocomplete field seems to be broken as an autocomplete field will always return a tid (based on what the core returns). I'm not sure this type of field should be kept at all to select the terms.

Remaining tasks

Decide what to do with the autocomplete selection mode.
Once the proposed patch is applied there is still an error when trying to save the view. To fix this this patch is required: https://www.drupal.org/project/drupal/issues/2925890 πŸ› Invalid config structures can result in exceptions when saving a config entity Needs work

User interface changes

None

API changes

None

Data model changes

None

πŸ› Bug report
Status

RTBC

Version

1.0

Component

Taxonomy

Created by

πŸ‡«πŸ‡·France nicoloye

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024