Values overwritten when multiple aggregated fields exist on same data source

Created on 31 January 2020, almost 5 years ago
Updated 19 September 2024, 3 months ago

When multiple aggregated fields are configured on the same data source, the values from the aggregated fields are overwritten by the value from the first aggregated field.

This became apparent to me when using the "Highlight" plugin on an aggregated field.

The issue is somewhat related to https://www.drupal.org/project/search_api/issues/2927748 β†’ .

In the FieldsHelper class in the extractItemValues method, it is not possible to pass an array of required properties containing multiple aggregated fields because the "aggregated_field" key collides.

I took a stab at solving this. Patch is working for me, but I think a closer look at the extractItemValues method is needed, as well as maybe provide a way to get the propertyPath including the field identifier from a Field item. Perhaps building on the existing Utility where methods as 'createCombinedId' already exist.

If someone with better understanding on the matter could have a look and point me in the right (or wanted) direction, that would we great.

πŸ› Bug report
Status

Needs work

Version

1.0

Component

Framework

Created by

πŸ‡§πŸ‡ͺBelgium wtrv

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024