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?
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | flag-dynamic-property-deprecation-3359763-3.patch | 375 bytes | michelle |
Comments
Comment #2
erald commentedComment #3
michelleBecause 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.
Comment #4
illeace commentedFixing typo in issue name
Comment #5
joelpittet@Michelle Thanks, that seems appropriate to reduce the deprecation warnings from PHP 8.2