You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the GLPI reports plugin this shows up as
PHP Deprecated function (8192): Creation of dynamic property PluginReportsAutoReport::$plug is deprecated in /var/www/html/glpi/plugins/reports/inc/autoreport.class.php at line 57
I'd like to submit a PR, but I don't think I'm likely to do that any time soon, as I don't know the plugin code (or GLPI, for that matter) well enough.
The text was updated successfully, but these errors were encountered:
I encountered the same deprecated warning with PHP 8.2 regarding the dynamic property creation in the GLPI reports plugin. The issue occurs because the creation of dynamic properties is deprecated in PHP 8.2 and will be removed in future versions.
To resolve this, we need to declare the properties explicitly within the class. Here's the solution that worked for us:
In the file reports/inc/autoreport.class.php, you need to declare the $plug property explicitly. Below is the modified code:
class PluginReportsAutoReport { private $plug; // Declare the property explicitly
By explicitly declaring the $plug property as a private property of the class, we eliminate the deprecated warning and adhere to the best practices recommended for future PHP versions.
I hope this helps others facing the same issue. If you need any further assistance or clarification, feel free to ask!
In the GLPI reports plugin this shows up as
PHP Deprecated function (8192): Creation of dynamic property PluginReportsAutoReport::$plug is deprecated in /var/www/html/glpi/plugins/reports/inc/autoreport.class.php at line 57
reports/inc/autoreport.class.php
Line 57 in 79bf1d9
See
https://stackoverflow.com/questions/74991682/php-8-2-dynamic-properties-deprecated-how-to-use-them-anyway-in-a-compatible-wa
for possible solutions. The options are to rework the class to not use dynamic properties, to extend stdClass, or to add an attribute.
Support will be dropped in PHP9, apparently, but that's not on the PHP version support grid yet https://www.php.net/supported-versions.php
I'd like to submit a PR, but I don't think I'm likely to do that any time soon, as I don't know the plugin code (or GLPI, for that matter) well enough.
The text was updated successfully, but these errors were encountered: