Deprecated function error on Require Revision Log Messages Form

Created on 5 January 2024, 6 months ago
Updated 6 January 2024, 6 months ago

Problem/Motivation

Hello,

I noticed an error after installing the module and going to the "Require Revision Log Messages" form:
Deprecated function: Creation of dynamic property Drupal\require_revision_log_message\Form\SettingsForm::$entityTypeManager is deprecated in Drupal\require_revision_log_message\Form\SettingsForm->__construct() (line 28 of modules/contrib/require_revision_log_message/src/Form/SettingsForm.php).

I went to the code and noticed that the variable $this->entityTypeManager is created dynamically and this is deprecated in PHP 8.2. I also noticed there is a declared variable in this class $entityFieldManager that is not used and I would say the intention at the beginning was to use this instead of $entityTypeManager but at some point the names were confused.

Steps to reproduce

  1. Install a new and fresh Drupal 10 site (I tested it in the version 10.2.0)
  2. Make sure the site is using PHP 8.2.
  3. Install the module.
  4. Go to the configuration form of the module.
  5. The error message is shown at the top.

Proposed resolution

Rename the variable $entityFieldManager to $entityTypeManager and change the declaration as required.

🐛 Bug report
Status

RTBC

Version

2.0

Component

Code

Created by

🇨🇴Colombia s_castro

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

Comments & Activities

Production build 0.69.0 2024