Problem/Motivation

When upgrading to PHP 8.2 I get the error
Deprecated function: Creation of dynamic property flag_node::$weight is deprecated in flag_flag->construct() (line 223 of /home/nginx/www/miami/sites/all/modules/contrib/flag/includes/flag/flag_flag.inc).
Deprecated function: Creation of dynamic property flag_node::$show_as_field is deprecated in flag_flag->construct() (line 223 of /home/nginx/www/miami/sites/all/modules/contrib/flag/includes/flag/flag_flag.inc).
etc..

Steps to reproduce

Just have flag installed and on nodes it give this error on every node displayed

Proposed resolution

Change code?

Comments

erald created an issue. See original summary.

erald’s picture

Issue summary: View changes
michelle’s picture

Version: 7.x-3.9 » 7.x-3.x-dev
Status: Active » Needs review
StatusFileSize
new375 bytes

Because the properties that are being dynamically added aren't fixed and can be altered by other modules, defining them all is not possible. I added #[AllowDynamicProperties] to suppress the deprecation warnings.

illeace’s picture

Title: PHP 8.2 depreciated problem » PHP 8.2 deprecated problem

Fixing typo in issue name

joelpittet’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -deprecated +PHP 8.2

@Michelle Thanks, that seems appropriate to reduce the deprecation warnings from PHP 8.2