InvalidArgumentException: The timestamp must be numeric. in Drupal\Component\Datetime\DateTimePlus::createFromTimestamp()

Created on 8 April 2024, 9 months ago

Problem/Motivation

InvalidArgumentException: The timestamp must be numeric. in Drupal\Component\Datetime\DateTimePlus::createFromTimestamp()

Steps to reproduce

1. Open the publication_date module
2. Display the Published on field in the display setting of admin/structure/types/manage/CONTENT TYPE/display
3. Create a node with content type d. Do not fill in the data in the Published on field.
4. An error will be reported when clicking preview

Proposed resolution

Add validation on the viewElements method of Drupal\Core\Field\Plugin\Field\FieldFormatter\TimestampFormatter, skip if it is empty

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

10.2

Component
Field 

Last updated 1 day ago

Created by

🇨🇳China randy tang

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

Comments & Activities

Production build 0.71.5 2024