First result is not made active if array key is 0

Created on 18 April 2023, over 1 year ago
Updated 8 September 2023, about 1 year ago

Problem/Motivation

Thanks for the module. I enabled the module and enabled the processor in a facet and it didn't work. The issue is the test for $first_result at https://git.drupalcode.org/project/facet_active_by_default/-/blob/1.0.x/... If the facet results array keys are numeric, and the first result has key 0, then if ($first_result) evaluates to false.

Proposed resolution

If the test is changed to $first_result !== NULL the then active by default processor correctly runs.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

πŸ‡³πŸ‡ΏNew Zealand jonathan_hunt

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

Comments & Activities

Production build 0.71.5 2024