Undefined array key "#default_value" when widget is hidden and no value provided in url

Created on 22 January 2025, 2 months ago

Problem/Motivation

When the widget of a facet is hidden and the facet is not present in the url, it results in a warning: Warning: Undefined array key "#default_value" in web/modules/contrib/better_exposed_filters/includes/better_exposed_filters.theme.inc on line 180

Steps to reproduce

  1. Add a facet to your view
  2. In the settings of "exposed form style", set the widget of this facet to "hidden"
  3. Save your view
  4. Go to the page of this view on your website

The warning will be shown indicating there was no value and no default value set for this hidden facet.

Proposed resolution

No warning is shown by checking if a default value is present when no value is present.

πŸ› Bug report
Status

Active

Version

7.0

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands Rik Wijnen

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

Comments & Activities

Production build 0.71.5 2024