[Views exposed filter] - Warnings on Date filter

Created on 15 August 2024, 3 months ago
Updated 16 August 2024, 3 months ago

Problem/Motivation

Views exposed form throws PHP warnings on AJAX reset.

Steps to reproduce

Set a better exposed date filter using between option. Add datepicker. Set dates, apply. Try to reset. In the console you can see:

<br/><b>Warning</b>:  Undefined array key "min" in <b>/var/www/html/web/core/modules/views/src/Plugin/views/filter/NumericFilter.php</b> on line <b>454</b><br/><br/><b>Warning</b>:  Undefined array key "min" in <b>/var/www/html/web/core/modules/views/src/Plugin/views/filter/Date.php</b> on line <b>147</b><br/><br/><b>Warning</b>:  Undefined array key "max" in <b>/var/www/html/web/core/modules/views/src/Plugin/views/filter/Date.php</b> on line <b>147</b><br/>[
    {

Proposed resolution

In file:
web/core/modules/views/src/Plugin/views/filter/NumericFilter.php:454
Change to:
if (empty($value['min']) && empty($value['max'])) {

In file:
web/core/modules/views/src/Plugin/views/filter/Date.php:147
Change to:
if (empty($this->value['min']) && empty($this->value['max'])) {

Remaining tasks

N/A

User interface changes

N/A

Introduced terminology

N/A

API changes

N/A

Data model changes

N/A

Release notes snippet

N/A

🐛 Bug report
Status

Closed: duplicate

Version

10.3

Component
Views 

Last updated about 6 hours ago

Created by

🇭🇺Hungary SunnyGambino Buj

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

Comments & Activities

Production build 0.71.5 2024