Exposed filter operators for Integer field when using List (integer) field.

Created on 31 May 2011, about 14 years ago
Updated 29 May 2025, 6 days ago

Maybe I'm catering to my own needs here a little, but I was surprised when I found these not to be available. Being that it's a list of integers, I expected to also see operators like <, >, =, is between, etc. I think these are pretty important operators with respect to integers and filtering, even if they are in lists.

ctrl/shift+click/radio/check boxes for selecting multiple values is complete enough, but in many cases excessive. I suppose crlt/shift+click with a select list can accomplish the same and more precise things as <,>, and =, but having to tell some adults that they can/need to do a combination of shift-clicks and ctrl-clicks makes me think it's not the best method for a lot of things.

Of course there are the other possibilities which are that what I'm asking for is already possible and I'm doing something wrong or that this isn't a View issue :/

Thoughts?

📌 Task
Status

Active

Version

11.2 🔥

Component

views.module

Created by

🇧🇷Brazil wedou

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

Merge Requests

Comments & Activities

Not all content is available!

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

  • 🇨🇾Cyprus alex.bukach

    Just tested it on a fresh Drupal 11.2.x install, and the issue still exists. Here are the steps to reproduce it:

    1. Add a "List (integer)" field to an entity type
    2. Add a filter for that list field to a view that displays that entity type
    3. See that available filter operators are only "Is one of", "Is all of", "Is none of", "Is empty (NULL)", "Is not empty (NOT NULL)", but numeric filters like "Is equal to", "Is greater than", "Is greater than or equal to" are missing. Those operators were available in Drupal 7.
  • 🇳🇿New Zealand quietone

    @alex.bukach, thanks for testing!

    This needs an issue summary update, using the standard issue template . And the information from the previous commented added there.

    If this problem was discovered on a version of Drupal that is not 11.x, add that information in the issue summary and leave the version at 11.x. In Drupal core changes are made on on 11.x (our main development branch) first, and are then back ported as needed according to the Core change policies . Also mentioned on the version section of the list of issue fields documentation.

  • Pipeline finished with Failed
    4 days ago
    Total: 1112s
    #511035
  • Pipeline finished with Failed
    4 days ago
    Total: 548s
    #511042
  • 🇨🇾Cyprus alex.bukach

    Here are respective patches.

  • 🇧🇷Brazil igorgoncalves

    Thanks @alex.bukach

    Just followed the steps to reproduce and i confirm that on a clean Drupal 11 instalation there's no "numeric filter" available for my integer field.

    And testing with the Merge Request there's numeric filter (screenshot below) and when i applied, the filter works as it should with "greater than" option, for example.

Production build 0.71.5 2024