Module creates dynamic property $base, deprecated as of PHP 8.2

Created on 12 March 2024, over 1 year ago
Updated 26 March 2024, over 1 year ago

Problem/Motivation

The UrlReplaceFilter filter uses dynamic property $base, but dynamic properties are deprecated since PHP 8.2, as pre https://www.php.net/manual/en/migration82.deprecated.php

This causes warnings to be emitted on admin pages when using the module on PHP 8.2 or higher.

Steps to reproduce

  • Install Drupal 10.2 on PHP 8.2.x
  • Add and enable the module
  • Observe messages like DEPRECATED FUNCTION: CREATION OF DYNAMIC PROPERTY DRUPAL\URL_REPLACE_FILTER\PLUGIN\FILTER\URLREPLACEFILTER::$BASE IS DEPRECATED IN DRUPAL\URL_REPLACE_FILTER\PLUGIN\FILTER\URLREPLACEFILTER->__CONSTRUCT() (LINE 78 OF MODULES/CONTRIB/URL_REPLACE_FILTER/SRC/PLUGIN/FILTER/URLREPLACEFILTER.PHP).

Proposed resolution

Remove all uses of dynamic properties by declaring properties.

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇫🇷France fgm Paris, France

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