Views empty Filter Operator List

Created on 18 December 2023, about 1 year ago
Updated 25 January 2024, 11 months ago

Problem/Motivation

I am encountering an issue where I am unable to retrieve the operator list for a filter in Drupal. Despite having operators exposed to the filter, the operator_list consistently returns an empty array. The problem seems to persist across all filters.

Below is the snippet of the query:

query UserListViewQuery {
  entityById(entityType: VIEW, id: "benutzer_view") {
    ... on View {
      executable(displayId: "default") {
        ... on ViewBenutzerViewDefault {
          itemsPerPage
          sorts {
            pluginId
          }
          filters {
            options
          }
          pager {
            perPage
            totalItems
          }
          execute(page: 0) {
            rows {
              entityBundle
              id
              ... on User {
                created
                fieldFirstName
                fieldLastName
                name
                id
                fieldPhoneNumber
              }
            }
          }
        }
      }
    }
  }
}

It appears that the operator_list array remains empty regardless of the configured operators for the filter. I would appreciate any insights or guidance on resolving this issue. Thank you!

🐛 Bug report
Status

Closed: cannot reproduce

Version

1.0

Component

Code

Created by

🇩🇪Germany Naitschi

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

Comments & Activities

  • Issue created by @Naitschi
  • 🇨🇭Switzerland ayalon

    I cannot reproduce that. I have created a view with exposed filters.

    query DemoQuery{
      entityById(entityType: VIEW, id: "search_content") {
        ... on View {
          executable(displayId: "default") {
            ... on ViewSearchContentDefault {
              itemsPerPage
              sorts {
                pluginId
              }
              filters {
                options
              }
              pager {
                perPage
                totalItems
              }
              execute(page: 0) {
                rows {
                  entityBundle
                  id
                  label
                }
              }
            }
          }
        }
      }
    }

    Result:

    {
      "data": {
        "entityById": {
          "executable": {
            "itemsPerPage": 0,
            "sorts": [],
            "filters": [
              {
                "options": {
                  "id": "type",
                  "table": "search_api_index_index",
                  "field": "type",
                  "relationship": "none",
                  "group_type": "group",
                  "admin_label": "",
                  "operator": "or",
                  "value": {
                    "page": "page"
                  },
                  "group": 1,
                  "exposed": true,
                  "expose": {
                    "operator_id": "type_op",
                    "label": "Inhaltstyp",
                    "description": "",
                    "use_operator": true,
                    "operator": "type_op",
                    "operator_limit_selection": true,
                    "operator_list": {
                      "or": "or"
                    },
                    "identifier": "type",
                    "required": false,
                    "remember": false,
                    "multiple": false,
                    "remember_roles": {
                      "authenticated": "authenticated",
                      "anonymous": "0",
                      "content_editor": "0",
                      "administrator": "0"
                    },
                    "reduce": false
                  },
                  "is_grouped": false,
                  "group_info": {
                    "label": "",
                    "description": "",
                    "identifier": "",
                    "optional": true,
                    "widget": "select",
                    "multiple": false,
                    "remember": false,
                    "default_group": "All",
                    "default_group_multiple": [],
                    "group_items": []
                  },
                  "reduce_duplicates": false,
                  "plugin_id": "search_api_options"
                }
              }
            ],
            "pager": {
              "perPage": 2,
              "totalItems": 0
            },
            "execute": {
              "rows": [
                {
                  "entityBundle": "page",
                  "id": "1",
                  "label": "Home"
                },
                {
                  "entityBundle": "page",
                  "id": "1",
                  "label": "Home"
                }
              ]
            }
          }
        }
      }
    }
    
    

    The selected operator is or, and the value is "page". If I enabled the Option "Limit the available operators", the array operator_list is filled.

  • Status changed to Closed: cannot reproduce 11 months ago
Production build 0.71.5 2024