TypeError: SearchApiQuery::addConditionGroup(): Argument #1 ($condition_group) must be of type ConditionGroupInterface, null given

Created on 30 January 2024, 11 months ago
Updated 29 February 2024, 10 months ago

Problem/Motivation

Error gets triggered when using filters in queries:

TypeError: Drupal\graphql_search_api_solr\Query\SearchApiQuery::addConditionGroup(): Argument #1 ($condition_group) must be of type Drupal\search_api\Query\ConditionGroupInterface, null given, called in /var/www/html/web/modules/contrib/graphql_search_api_solr/src/Plugin/GraphQL/DataProducer/SearchApi/SolrSearch.php on line 341 in Drupal\graphql_search_api_solr\Query\SearchApiQuery->addConditionGroup() (Zeile 244 in /var/www/html/web/modules/contrib/graphql_search_api_solr/src/Query/SearchApiQuery.php).

Steps to reproduce

Execute a query with filters:

solrSearch(
    index: "my_index"
    query: $searchQueryString
    offset: $offset
    sort: {
      field: "sort_key"
      order: "desc"
    }
    
    filters: [
      {
        conjunction: "AND",
        tag: "",
        conditions: [
          {
            field: "filter_field"
            values: "some filter value"
          }
        ]
      }
    ]
  ) {
    count
    documents {
      ... on SolrDocument {
        id
        title
    }
  }
}

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Fixed

Version

1.3

Component

Code

Created by

🇩🇪Germany daveiano

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024