Datetime filter causes error in PHP8.1 / D9.5.9

Created on 26 June 2023, about 1 year ago
Updated 27 June 2023, about 1 year ago

Problem/Motivation

Datetime filter causes error in PHP8.1 / D9.5.9 as the value is not in the right format.

26-Jun-2023 12:37:18] WARNING: [pool www] child 1200 said into stderr: "NOTICE: PHP message: TypeError: Cannot access offset of type string on string in /project/app/public/core/modules/datetime/src/Plugin/views/filter/Date.php on line 130 #0 /project/app/public/core/modules/views/src/Plugin/views/filter/NumericFilter.php(330): Drupal\datetime\Plugin\views\filter\Date->opSimple()"
[26-Jun-2023 12:37:18] WARNING: [pool www] child 1200 said into stderr: "#1 /project/app/public/core/modules/views/src/ViewExecutable.php(1378): Drupal\views\Plugin\views\filter\NumericFilter->query()"
[26-Jun-2023 12:37:18] WARNING: [pool www] child 1200 said into stderr: "#2 /project/app/public/core/modules/views/src/ViewExecutable.php(1267): Drupal\views\ViewExecutable->_build()"
[26-Jun-2023 12:37:18] WARNING: [pool www] child 1200 said into stderr: "#3 /project/app/public/core/modules/views/src/ViewExecutable.php(1396): Drupal\views\ViewExecutable->build()"

Proposed resolution

- Add a separate DateTime filter plugin to return the value as an array in the form ['value' => $value].

API changes

New DateTime plugin

πŸ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡¨πŸ‡­Switzerland pvbergen

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

Comments & Activities

Production build 0.69.0 2024