Skip to content

Advanced search - white screen when aggregated filter combined with non-aggregated #304

@patdunlavey

Description

@patdunlavey

When performing an advanced search where an sbf aggregated fulltext search is combined with a content field fulltext search, I get...

The website encountered an unexpected error. Please try again later.
TypeError: Drupal\search_api_solr\Utility\Utility::flattenKeys(): Argument #2 ($fields) must be of type array, bool given, called in /var/www/html/web/modules/contrib/format_strawberryfield/modules/format_strawberryfield_views/src/Plugin/views/filter/AdvancedSearchApiFulltext.php on line 422 in Drupal\search_api_solr\Utility\Utility::flattenKeys() (line 748 of modules/contrib/search_api_solr/src/Utility/Utility.php).
Drupal\search_api_solr\Utility\Utility::flattenKeys(Array, , 'terms') (Line: 422)
Drupal\format_strawberryfield_views\Plugin\views\filter\AdvancedSearchApiFulltext->query() (Line: 1378)

The problem seems to be here: https://github.com/esmero/format_strawberryfield/blob/1.1.0/modules/format_strawberryfield_views/src/Plugin/views/filter/AdvancedSearchApiFulltext.php#L421, where $query_able_datum_fields['aggregated'] should be $query_able_datum_internal['aggregated']. The state of $query_able_datum_internal['aggregated'] on this line is whatever it was left in the earlier foreach loop.

If it helps make this clearer, here is an example what the url parameters look like:
?sbf_advanced_search_api_fulltext=Amherst&sbf_advanced_search_api_fulltext_searched_fields=sbf_aggregated_items&sbf_advanced_search_api_fulltext_advanced_search_fields_count=2&sbf_advanced_search_api_fulltext_group_operator_1=and&sbf_advanced_search_api_fulltext_1=december&sbf_advanced_search_api_fulltext_searched_fields_1=title

Metadata

Metadata

Assignees

Labels

Search APISearch and DiscoveryMess around and find outSub ModulesWhen you need more .info.yml files to keep life organizedbugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions