Deprecated function error with PHP 8.2 in Drupal 10

Created on 23 March 2023, over 1 year ago
Updated 19 April 2023, over 1 year ago

Problem/Motivation

Following PHP error occurred with PHP 8.2 in a Drupal 10 installation.

Steps to reproduce

  1. Enable event_log_track_ui module.
  2. Login the website.
  3. The following PHP error is occurred.
  4. Deprecated function: Creation of dynamic property Drupal|Core\Form|FormState::$_event_log_track_logged is deprecated in event_log _track ui_form_submit) (line 21 of modules/contrib/events_log_track/modules/event_log_track ui/event_log_track ui.module).

Test environment:
Drupal core: 10.0.5
PHP version: PHP 8 >= 8.2.0

Reference:
https://www.php.net/manual/en/migration82.deprecated.php
https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Form%21Fo...
https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Form%21Fo...

Proposed resolution

Use FormState::hasTemporaryValue() and FormState::setTemporaryValue() instead.

Remaining tasks

N/A

User interface changes

N/A

API changes

N/A

Data model changes

N/A

πŸ› Bug report
Status

Fixed

Version

3.1

Component

Code

Created by

πŸ‡¦πŸ‡ΊAustralia mingsong πŸ‡¦πŸ‡Ί

Live updates comments and jobs are added and updated live.
  • PHP 8.2

    The issue particularly affects sites running on PHP version 8.2.0 or later.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024