Creation of dynamic property is deprecated

Created on 23 February 2024, 9 months ago
Updated 18 June 2024, 5 months ago

Problem/Motivation

Drupal 10 PHP 8.3
Deprecated function : Creation of dynamic property Drupal\role_based_theme_switcher\Theme\RoleNegotiator::$theme is deprecated in Drupal\role_based_theme_switcher\Theme\RoleNegotiator->applies() (/var/www/platform/web/modules/contrib/role_based_theme_switcher/src/Theme/RoleNegotiator.php ligne 81)

Switching from a theme to another doesn't work.

Steps to reproduce

Enable the module role_based_theme_switcher

Proposed resolution

To fix the error, modify the class and declare all properties explicitly.
Instead of dynamically assigning properties in the constructor (variable $theme in the case), declare it in the class definition.

๐Ÿ› Bug report
Status

Needs review

Version

3.0

Component

Code

Created by

๐Ÿ‡ง๐Ÿ‡ชBelgium xdequinze 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