Skip to content

Conversation

@MurzNN
Copy link
Contributor

@MurzNN MurzNN commented Nov 11, 2020

When executing queries with ConditionGroup, that doesn't contain operator (that is not required), Drupal shows the notice:

Notice: Undefined index: operator in Drupal\graphql_search_api\Plugin\GraphQL\Fields\SearchAPISearch->addConditionGroup() (line 172 of web/modules/contrib/graphql_search_api/src/Plugin/GraphQL/Fields/SearchAPISearch.php).

Here is fix for this notice. Instead of if checking, I use the ?? construction, that must be available in PHP 7.0+

Also value may be not required too (for example, if operator = "IS_NULL"), so I add NULL replacement to it.

When executing queries with ConditionGroup, that doesn't contain operator (that is not required), Drupal shows the notice:
```
Notice: Undefined index: operator in Drupal\graphql_search_api\Plugin\GraphQL\Fields\SearchAPISearch->addConditionGroup() (line 172 of web/modules/contrib/graphql_search_api/src/Plugin/GraphQL/Fields/SearchAPISearch.php).
```
Here is fix for this notice. Instead of `if` checking, I use the `??` construction, that must be available in PHP 7.0+

Also `value` may be not required too, so I add `NULL` replacement to it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant