Undefined method getDateTime()

Created on 1 November 2019, about 5 years ago
Updated 24 June 2024, 7 months ago

I keep getting the following error when I try to include a date field in the context of a Rules Action (send email). Having looked at the code, I can indeed agree that there is no getDateTime() function, or anything like it, on the object (TypedDataInterface : DateTimeFieldItemList) that the code gets around line 78:

I'm using Drupal 8.7.8.

Error: Call to undefined method Drupal\datetime\Plugin\Field\FieldType\DateTimeItem::getDateTime() in Drupal\typed_data\Plugin\TypedDataFilter\FormatDateFilter->filter() (line 84 of modules/contrib/typed_data/src/Plugin/TypedDataFilter/FormatDateFilter.php).
Drupal\typed_data\Plugin\TypedDataFilter\FormatDateFilter->filter(Object, Array, Array, NULL) (Line: 78)
Drupal\typed_data\PlaceholderResolver->resolvePlaceholders('Your daily verse for {{ node.field_date.0 |format_date("medium") }}:
{{ node.body.0.value }}

Nic', Array, NULL, Array) (Line: 167)
Drupal\typed_data\PlaceholderResolver->replacePlaceHolders('Your daily verse for {{ node.field_date.0 |format_date("medium") }}:
{{ node.body.0.value }}

Nic', Array) (Line: 70)
Drupal\rules\Plugin\RulesDataProcessor\TokenProcessor->process('Your daily verse for {{ node.field_date.0 |format_date("medium") }}:
{{ node.body.0.value }}

Nic', Object) (Line: 324)
Drupal\rules\Plugin\RulesExpression\ActionExpression->processValue('Your daily verse for {{ node.field_date.0 |format_date("medium") }}:
{{ node.body.0.value }}

Nic', Array, Object) (Line: 301)
πŸ› Bug report
Status

Active

Version

2.1

Component

Data filters

Created by

πŸ‡¬πŸ‡§United Kingdom rivimey

Live updates comments and jobs are added and updated live.
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