[Views exposed filter] - Warnings on Date filter min & max

Created on 25 September 2023, about 1 year ago
Updated 9 September 2024, about 1 month ago

Problem/Motivation

Views exposed form throws PHP warnings on AJAX reset. The form having between field of date.

<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/>[
    {

Steps to reproduce

  • Create view page
  • Add Date filter and set to exposed
  • Add Date filter and group
  • - +7 days
  • - + 30 days
  • Set dates, apply.

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

MR and test

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Needs review

Version

11.0 🔥

Component
Datetime 

Last updated about 1 hour ago

Created by

🇵🇭Philippines _renify_ cebu

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