Datetime module makes assumptions about fields when defining its Views filter

Created on 18 May 2018, over 7 years ago
Updated 6 August 2025, 16 days ago

Problem/Motivation

An entity that defines a field of type datetime and a Views filter of datetime gets an error of Error: Call to a member function getSetting() on null in /core/modules/datetime/src/Plugin/views/filter/Date.php when adding that filter in a view of that entity.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Original report

See the related issue for more details. Though the title of the related issue refers to a problem in the options module, the overall problem is the same as mentioned in comment 9 β†’ .

For the purpose of discoverability I am including the specific error related to this module.

Error: Call to a member function getSetting() on null in /core/modules/datetime/src/Plugin/views/filter/Date.php

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component

datetime.module

Created by

πŸ‡ΊπŸ‡ΈUnited States vegantriathlete Lakewood, CO

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.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

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