Deprecated function: Creation of dynamic property Drupal\enum_field\ComputedEnum::$value is deprecated

Created on 14 July 2024, 12 months ago
Updated 28 July 2024, 11 months ago

Problem/Motivation

Dynamic properties are deprecated in PHP 8.2. We get this error:

Deprecated function: Creation of dynamic property Drupal\enum_field\ComputedEnum::$value is deprecated in Drupal\Core\TypedData\TypedData->setValue() (line 102 of core/lib/Drupal/Core/TypedData/TypedData.php).

Proposed resolution

Looking at how other modules fixed this, adding $value as a class variable seems to fix it: https://www.drupal.org/project/publication_date/issues/3328575 📌 Fix PHP 8.2 deprecation issue with PublishedAtOrNowComputed class Fixed

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇧🇪Belgium dieterholvoet Brussels

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024