Problem/Motivation

\Drupal\datetime\DateTimeComputed::getValue() can cause deprecations on PHP 8.1.

Steps to reproduce

Run \Drupal\Tests\datetime\Functional\DateTimeFieldTest on PHP 8.1

Proposed resolution

Return early if $value is NULL.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#2 3240181-2.patch777 bytesalexpott

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review
Issue tags: +PHP 8.1
Parent issue: » #3220021: [meta] Ensure compatibility of Drupal 9 with PHP 8.1 (as it evolves)
StatusFileSize
new777 bytes

Here's the fix from the meta.

daffie’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

  • catch committed 4de479c on 9.3.x
    Issue #3240181 by alexpott: \Drupal\datetime\DateTimeComputed::getValue...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 4de479c and pushed to 9.3.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.