Deprecated function: Creation of dynamic property (with php 8.2)

Created on 3 August 2023, 11 months ago
Updated 21 September 2023, 9 months ago

Problem/Motivation

Every time the ah module is accessed a php debug message is logged as follow:

Deprecated function: Creation of dynamic property
 Drupal\advanced_help\AdvancedHelpManager::$theme_handler is deprecated in
 Drupal\advanced_help\AdvancedHelpManager->__construct() (line 44 of
 pathToDrupal10\web\modules\contrib\advanced_help\src\AdvancedHelpManager.php).
 
 Deprecated function: Creation of dynamic property
 Drupal\advanced_help\AdvancedHelpManager::$module_handler is deprecated in Drupal\advanced_help\AdvancedHelpManager->__construct() (line 43 of
 pathToDrupal10\web\modules\contrib\advanced_help\src\AdvancedHelpManager.php).

Steps to reproduce

  1. Enable the module with your php version is 8.2
  2. Go to admin/help/ah
  3. Check your log messages.

Repeat the above after changing your server php version to 8.1 and you should see no more logged messages about the issue.

Proposed resolution

Per this PHP doc, creation of dynamic properties is deprecated and need updating the code to be compatible with PHP 8.2

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

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.69.0 2024