Skip to content
Snippets Groups Projects
Commit 59d9477b authored by Andrey Rachinskiy's avatar Andrey Rachinskiy Committed by Andriy Khomych
Browse files

Issue #3354186 by Rachinskiy: Deprecated function:...

Issue #3354186 by Rachinskiy: Deprecated function: DateTime::createFromFormat(): Passing null to parameter #2 ($datetime) of type string is deprecated in Drupal\Component\Datetime\DateTimePlus::createFromFormat() (line 251 of core/lib/Drupal/Component/Datetime/DateTimePlus.php)
parent b44a6e15
No related branches found
No related tags found
No related merge requests found
......@@ -45,7 +45,7 @@ class DateDayComputed extends TypedData {
/** @var \Drupal\Core\Field\FieldItemInterface $item */
$item = $this->getParent();
$value = $item->{($this->definition->getSetting('date source'))};
$value = $item->{($this->definition->getSetting('date source'))} ?? '';
$storage_format = DateTimeItemInterface::DATE_STORAGE_FORMAT;
try {
......
......@@ -46,7 +46,7 @@ class DateTimeDayComputed extends TypedData {
/** @var \Drupal\Core\Field\FieldItemInterface $item */
$item = $this->getParent();
$value = $item->{($this->definition->getSetting('date source'))};
$value = $item->{($this->definition->getSetting('date source'))} ?? '';
$datetime_type = $item->getFieldDefinition()->getSetting('time_type');
$storage_format = $datetime_type === DateTimeDayItem::DATEDAY_TIME_DEFAULT_TYPE_FORMAT ? DateTimeDayItem::DATE_TIME_DAY_H_I_FORMAT_STORAGE_FORMAT : DateTimeDayItem::DATE_TIME_DAY_H_I_S_FORMAT_STORAGE_FORMAT;
// Fix time with seconds in incorrect widget.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment