order icon indicating copy to clipboard operation
order copied to clipboard

Bug when trying to add Modal in the Data Injection Plugin - PHP Deprecated function (8192): Creation of dynamic property PluginOrderOrderInjection::$table is deprecated

Open xraive opened this issue 9 months ago • 4 comments

Code of Conduct

  • [ ] I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • [ ] I have searched the existing issues

GLPI Version

10.0.18

Plugin version

Name: Orders management Version: 2.10.7

Bug description

When trying to add a modal using the data injection plugin, I receive the following errors.

PHP Deprecated function (8192): Creation of dynamic property PluginOrderOrderInjection::$table is deprecated in /var/www/html/glpi/marketplace/order/inc/orderinjection.class.php at line 39 PHP Deprecated function (8192): Creation of dynamic property PluginOrderOrderInjection::$table is deprecated in /var/www/glpi/glpi/marketplace/order/inc/orderinjection.class.php at line 39 PHP Deprecated function (8192): Creation of dynamic property PluginOrderReferenceInjection::$table is deprecated in /var/www/glpi/glpi/marketplace/order/inc/referenceinjection.class.php at line 39 PHP Deprecated function (8192): Creation of dynamic property PluginOrderReferenceInjection::$table is deprecated in /var/www/glpi/glpi/marketplace/order/inc/referenceinjection.class.php at line 39

Relevant log output

[2025-05-01 02:04:57] glpiphplog.WARNING: Test logger
[2025-05-01 02:07:15] glpiphplog.NOTICE: *** PHP Deprecated function (8192): Creation of dynamic property PluginOrderOrderInjection::$table is deprecated in /var/www/glpi/glpi/marketplace/order/inc/orderinjection.class.php at line 39
Backtrace :
...ce/datainjection/inc/injectiontype.class.php:53 PluginOrderOrderInjection->__construct()
...ce/datainjection/inc/injectiontype.class.php:93 PluginDatainjectionInjectionType::getItemtypes()
marketplace/datainjection/inc/model.class.php:703 PluginDatainjectionInjectionType::dropdown()
marketplace/datainjection/inc/model.class.php:623 PluginDatainjectionModel->showAdvancedForm()
src/CommonGLPI.php:680 PluginDatainjectionModel->showForm()
ajax/common.tabs.php:120 CommonGLPI::displayStandardTab()
public/index.php:82 require()

[2025-05-01 02:07:15] glpiphplog.NOTICE: *** PHP Deprecated function (8192): Creation of dynamic property PluginOrderOrderInjection::$table is deprecated in /var/www/glpi/glpi/marketplace/order/inc/orderinjection.class.php at line 39
Backtrace :
...ce/datainjection/inc/injectiontype.class.php:60 PluginOrderOrderInjection->__construct()
...ce/datainjection/inc/injectiontype.class.php:93 PluginDatainjectionInjectionType::getItemtypes()
marketplace/datainjection/inc/model.class.php:703 PluginDatainjectionInjectionType::dropdown()
marketplace/datainjection/inc/model.class.php:623 PluginDatainjectionModel->showAdvancedForm()
src/CommonGLPI.php:680 PluginDatainjectionModel->showForm()
ajax/common.tabs.php:120 CommonGLPI::displayStandardTab()
public/index.php:82 require()

[2025-05-01 02:07:15] glpiphplog.NOTICE: *** PHP Deprecated function (8192): Creation of dynamic property PluginOrderReferenceInjection::$table is deprecated in /var/www/glpi/glpi/marketplace/order/inc/referenceinjection.class.php at line 39
Backtrace :
...ce/datainjection/inc/injectiontype.class.php:53 PluginOrderReferenceInjection->__construct()
...ce/datainjection/inc/injectiontype.class.php:93 PluginDatainjectionInjectionType::getItemtypes()
marketplace/datainjection/inc/model.class.php:703 PluginDatainjectionInjectionType::dropdown()
marketplace/datainjection/inc/model.class.php:623 PluginDatainjectionModel->showAdvancedForm()
src/CommonGLPI.php:680 PluginDatainjectionModel->showForm()
ajax/common.tabs.php:120 CommonGLPI::displayStandardTab()
public/index.php:82 require()

[2025-05-01 02:07:15] glpiphplog.NOTICE: *** PHP Deprecated function (8192): Creation of dynamic property PluginOrderReferenceInjection::$table is deprecated in /var/www/glpi/glpi/marketplace/order/inc/referenceinjection.class.php at line 39
Backtrace :
...ce/datainjection/inc/injectiontype.class.php:60 PluginOrderReferenceInjection->__construct()
...ce/datainjection/inc/injectiontype.class.php:93 PluginDatainjectionInjectionType::getItemtypes()
marketplace/datainjection/inc/model.class.php:703 PluginDatainjectionInjectionType::dropdown()
marketplace/datainjection/inc/model.class.php:623 PluginDatainjectionModel->showAdvancedForm()
src/CommonGLPI.php:680 PluginDatainjectionModel->showForm()
ajax/common.tabs.php:120 CommonGLPI:

Page URL

http://glpi/marketplace/datainjection/front/model.form.php

Steps To reproduce

  1. Go to Data Injection
  2. Try to add a modal

Your GLPI setup information

No response

Anything else?

No response

xraive avatar May 03 '25 19:05 xraive

After reviewing the following link https://php.watch/versions/8.2/dynamic-properties-deprecated I was able to resolve my issue by adding #[AllowDynamicProperties] in the code below, filename referenceinjection.class.php

#[AllowDynamicProperties] class PluginOrderReferenceInjection extends PluginOrderReference implements PluginDatainjectionInjectionInterface { public function __construct() { $this->table = getTableForItemType(get_parent_class($this)); }

and in the filename orderinection.class.php

#[AllowDynamicProperties] class PluginOrderOrderInjection extends PluginOrderOrder implements PluginDatainjectionInjectionInterface { public function __construct() { $this->table = getTableForItemType(get_parent_class($this)); }

After a restart of Apache, the errors were removed. I know this is temporary, will this be addressed in a future version?

xraive avatar May 09 '25 19:05 xraive

There has been no activity on this issue for some time and therefore it is considered stale and will be closed automatically in 10 days.

If this issue is related to a bug, please try to reproduce on latest release. If the problem persist, feel free to add a comment to revive this issue. If it is related to a new feature, please open a topic to discuss with community about this enhancement on suggestion website.

You may also consider taking a subscription to get professionnal support or contact GLPI editor team directly.

github-actions[bot] avatar May 25 '25 08:05 github-actions[bot]

Seems like a real issue to get fixed, but adding #[AllowDynamicProperties] seems not the correct way to go. Property should be correctly declared in parent class.

trasher avatar Jun 02 '25 06:06 trasher

There has been no activity on this issue for some time and therefore it is considered stale and will be closed automatically in 10 days.

If this issue is related to a bug, please try to reproduce on latest release. If the problem persist, feel free to add a comment to revive this issue. If it is related to a new feature, please open a topic to discuss with community about this enhancement on suggestion website.

You may also consider taking a subscription to get professionnal support or contact GLPI editor team directly.

github-actions[bot] avatar Jun 18 '25 08:06 github-actions[bot]