Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292377

DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated

$
0
0

Problem/Motivation

After update Drupal code to 9.3.13 and PHP 8.1 there are DateTime warnings.

Deprecated function: DateTime::__construct(): Passing null to parameter #1 ($datetime) of type string is deprecated in Drupal\Component\Datetime\DateTimePlus->__construct() (line 309 of /var/www/docroot/core/lib/Drupal/Component/Datetime/DateTimePlus.php)
#0 /var/www/docroot/core/includes/bootstrap.inc(346): _drupal_error_handler_real(8192, 'DateTime::__con...', '/var/www/docroo...', 309)
#1 [internal function]: _drupal_error_handler(8192, 'DateTime::__con...', '/var/www/docroo...', 309)
#2 /var/www/docroot/core/lib/Drupal/Component/Datetime/DateTimePlus.php(309): DateTime->__construct(NULL, Object(DateTimeZone))
#3 /var/www/docroot/core/lib/Drupal/Core/Datetime/DrupalDateTime.php(88): Drupal\Component\Datetime\DateTimePlus->__construct(NULL, NULL, Array)
#4 /var/www/docroot/core/lib/Drupal/Core/Datetime/DateHelper.php(477): Drupal\Core\Datetime\DrupalDateTime->__construct(NULL)
#5 /var/www/docroot/modules/contrib/openy_custom/openy_repeat_entity/src/Entity/Repeat.php(230): Drupal\Core\Datetime\DateHelper::daysInYear()
#6 /var/www/docroot/core/lib/Drupal/Core/Entity/EntityFieldManager.php(228): Drupal\openy_repeat_entity\Entity\Repeat::baseFieldDefinitions(Object(Drupal\Core\Entity\ContentEntityType))
#7 /var/www/docroot/core/lib/Drupal/Core/Entity/EntityFieldManager.php(193): Drupal\Core\Entity\EntityFieldManager->buildBaseFieldDefinitions('repeat')
#8 /var/www/docroot/core/lib/Drupal/Core/Entity/EntityFieldManager.php(448): Drupal\Core\Entity\EntityFieldManager->getBaseFieldDefinitions('repeat')
#9 /var/www/docroot/modules/contrib/address/address.tokens.inc(31): Drupal\Core\Entity\EntityFieldManager->getFieldStorageDefinitions('repeat')
#10 [internal function]: address_token_info()

Steps to reproduce

Drupal Core version - 9.3.13
PHP version - 8.1
See warning messages.


Viewing all articles
Browse latest Browse all 292377

Trending Articles