Closed (outdated)
Project:
Date time day
Version:
2.0.2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Jan 2026 at 13:55 UTC
Updated:
16 Sep 2026 at 00:18 UTC
Jump to comment: Most recent
This error occurred for me when trying to add a new field to a content type. I removed the 'string' type declaration for these constants:
Before:
class DateTimeDayItem extends DateTimeItem {
/**
* Values for the 'time_type' setting: store only a time, time & seconds.
*/
const string DATEDAY_TIME_DEFAULT_TYPE_FORMAT = 'time';
const string DATE_TIME_DAY_H_I_FORMAT_STORAGE_FORMAT = 'H:i';
const string DATEDAY_TIME_TYPE_SECONDS_FORMAT = 'time_seconds';
const string DATE_TIME_DAY_H_I_S_FORMAT_STORAGE_FORMAT = 'H:i:s';
After:
class DateTimeDayItem extends DateTimeItem {
/**
* Values for the 'time_type' setting: store only a time, time & seconds.
*/
const DATEDAY_TIME_DEFAULT_TYPE_FORMAT = 'time';
const DATE_TIME_DAY_H_I_FORMAT_STORAGE_FORMAT = 'H:i';
const DATEDAY_TIME_TYPE_SECONDS_FORMAT = 'time_seconds';
const DATE_TIME_DAY_H_I_S_FORMAT_STORAGE_FORMAT = 'H:i:s';
Comments
Comment #2
andriy khomych commentedHey Tom O'Dea!
Please refer to Drupal 11 requirements.
https://www.drupal.org/docs/getting-started/system-requirements/php-requ...
It means that we need to use PHP 8.2
Maybe I should release a separate major version, but I think it makes more sense update to PHP 8.2 as it is widely supported by Drupal.
Comment #3
todea commentedI see. PHP 8.3 supports typed constants. We got this error in an environment with 8.2
Comment #4
andriy khomych commentedMy bad, it seems it was introduced in PHP 8.3
Comment #5
andriy khomych commented