No valid values found on filter taxonomy (Is one of)

Created on 27 November 2023, 7 months ago
Updated 29 April 2024, about 2 months ago

Problem/Motivation

When filtering by taxonomy term, the Operator "Is one of", "Leave blank for all" is not working. You cannot save the view and it shows "No valid values found on filter: Content: (taxonomy vocab name)"

Steps to reproduce

In a default Drupal installation, we should have taxonomy vocab "Tags", and content type "Article" with field_tags.

1. Create 2 terms under the taxonomy vocab "Tags", e.g. 'tag1', 'tag2'
2. Create a new view, by default it has filter "Content: Published (= Yes)"
3. Add another filter "Tags (field_tags)"
4. On first pop modal. Under "Vocabulary", choose "Tags". Under "Selection type", choose "Dropdown"
5. On second pop modal. Under the "Operator", choose "Is one of". Under "Select terms from vocabulary Tags", do not select anything. i.e. as the description suggested "Leave blank for all"
6. "Apply"
7. You will not able to save this view.

Proposed resolution

In order to save this view, you have to select all terms in step 5 above.

πŸ› Bug report
Status

Closed: works as designed

Version

11.0 πŸ”₯

Component
ViewsΒ  β†’

Last updated less than a minute ago

Created by

πŸ‡¨πŸ‡¦Canada francismak

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

Comments & Activities

  • Issue created by @francismak
  • πŸ‡¦πŸ‡ΊAustralia ahsanra Sydney, Australia

    I am having same issue not sure what is wrong.

    Probably the "Select all" is missing from the selection which should fix the error although leave blank messages is there.

  • πŸ‡΅πŸ‡­Philippines abhaypai

    I believe this works as expected and proposed resolution is good solution for the time being according to the reporter although it is true that "Leave blank for all" is misleading according to my understanding if administrator doesnt wanna configure it via expose filter option.

    Just sourcing above information based on my initial level of debugging and saw that "All" option or Default value only works with exposed filter as per this and this line number.

    I will leave it up to the reviewer or reporter, if this issue can be closed (works as designed).

  • πŸ‡¦πŸ‡ΊAustralia ahsanra Sydney, Australia

    Great information specially the code @abhaypai.

    I do not understand why the ALL option is disabled for filter options, why is it visible only on exposed filters fronted?

    It should be available on backed as well.

  • πŸ‡¦πŸ‡ΊAustralia ahsanra Sydney, Australia

    Honestly, i think this requires a fix to keep using taxonomy filters in views for Drupal 10.

    I am also not sure why this was not picked up before or may be there is a workaround to pick "Select All" instead of picking all terms for the filters.

  • Status changed to Postponed: needs info 7 months ago
  • πŸ‡³πŸ‡±Netherlands Lendude Amsterdam

    While I agree that the text might be a bit misleading, what would be the use case for an non-exposed term filter that doesn't filter on anything? Or am I missing something?

    It works fine for an exposed filter, and the text makes sense in that scenario too. Maybe we could be more specific that this only goes for exposed filters (and when not using the empty/not empty operator for which the value setting makes no sense at all to begin with)

    So would an updated description be sufficient here?

  • πŸ‡·πŸ‡ΈSerbia darko_antunovic

    I am facing the same issue now.

    What I want to achieve with my view is that I display the taxonomy terms, want to mark them all as required, but generate them dynamically through a hook (or alter them, that's the better phrase).

    This practically means that not always will I have the same taxonomies displayed, and not always will the same taxonomy be the default one.

  • I am currently facing the same problem, but the problem occurs when the filter is marked as Required, what is the solution for this problem??

  • Status changed to Closed: works as designed about 2 months ago
  • πŸ‡¨πŸ‡¦Canada francismak

    Hi @lendude, for my use case, I wanted to create a views to show list of content that are belongs to all terms under a vocabulary. And there is no need to expose this filter.

    I am able to accomplish this by selecting all the terms and save(which means include all terms).
    However, if I create a new term later on, I have to go back to the views and add the new terms to save it.

    And after reviewing other's comments, I realized I may mis-understood the usage of 'filter'. Instead of using filter, I should use the "Relationships" to restrict the results from particular vocabulary.

    It could be another ticket whether the text "Leave blank for all" is misleading or not. That's an UI issue, but not a defect.

    Closing this now, thx everybody.

Production build 0.69.0 2024