Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISSUE-304 --- Use the correct variable name for the aggregated fields #305

Merged
merged 1 commit into from
May 24, 2023

Conversation

patdunlavey
Copy link
Collaborator

$query_able_data gets iterated twice, the first time with its members called $query_able_datum_fields, and the second time as $query_able_datum_internal. During the second round of iterations ($query_able_datum_internal), the $query_able_datum_fields variable was referenced, which may or may not be the same as the current $query_able_datum_internal variable. When it is the same, no problem. But when it's not, the $query_able_datum_fields['aggregated'] may not be an array. This causes \Drupal\search_api_solr\Utility\Utility::flattenKeys to fatal error.

The fix is to change out $query_able_datum_fields['aggregated'] for $query_able_datum_internal['aggregated'].

For good measure, I added in extra validity checking for $query_able_datum_internal['aggregated'], though I don't think it's strictly necessary.

To test, create advanced searches using multiple filters, sbf aggregated fulltext and content fulltext, with at least one content fulltext filter following an sbf aggregated fulltext filter.

$query_able_data gets iterated twice, the first time with its members called $query_able_datum_fields, and the second time as $query_able_datum_internal. During the second round of iterations ($query_able_datum_internal), the $query_able_datum_fields variable was referenced, which may or may not be the same as the current $query_able_datum_internal variable. When it is, no problem. But when it's not, the $query_able_datum_fields['aggregated'] may not be an array. 
The fix is to change out $query_able_datum_fields['aggregated'] for $query_able_datum_internal['aggregated'].
For good measure, I added in extra validity checking for $query_able_datum_internal['aggregated'], though I don't think it's strictly necessary.
Copy link
Member

@DiegoPino DiegoPino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. makes sense

@DiegoPino DiegoPino added bug Something isn't working Search and Discovery Mess around and find out Search API Sub Modules When you need more .info.yml files to keep life organized labels May 24, 2023
@DiegoPino DiegoPino merged commit afdac18 into esmero:1.1.0 May 24, 2023
@DiegoPino
Copy link
Member

Thanks @patdunlavey for finding and fixing this! 🎆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Search and Discovery Mess around and find out Search API Sub Modules When you need more .info.yml files to keep life organized
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants