filterBundles always sets the value to an empty array

Created on 8 November 2022, about 2 years ago
Updated 19 January 2023, almost 2 years ago

Problem/Motivation

Field value in filterBundles method will always be empty because it checks the bundle against the array keys of $field_config['selected_bundles'] and therefore the whole functionality of the module will be broken.

Steps to reproduce

I'm using Drupal 9.4.8, Search api 1.27.0, and facets 2.0.5.
Following the instructions provided in the readme file with the above versions will reproduce the issue.

Proposed resolution

use in_array() instead of array_key_exists.

I added a patch that does the following:

  • replace array_key_exists with in_array().
  • remove unused variable $convert_labels.
  • prevent access to $field_config['field_status'] when $field_config is empty.
🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

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

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