ocsinventoryng
ocsinventoryng copied to clipboard
PHP warning with 10.0.7
Hi, running ocsi inventory ng version 2.0.4 on GLPI 10.0.7, I see a lot of these PHP warnings in the GLPI error log:
[2023-06-16 13:21:38] glpiphplog.WARNING: *** PHP Warning (2): Undefined array key "ocsservers_id" in /var/www/glpi/marketplace/ocsinventoryng/hook.php at line 1377
[2023-06-16 13:21:38] glpiphplog.WARNING: *** PHP Warning (2): Undefined array key "plugin_ocsinventoryng_ocsservers_id" in /var/www/glpi/marketplace/ocsinventoryng/hook.php at line 1379
[2023-06-16 13:22:43] glpiphplog.WARNING: *** PHP User Warning (512): Relation between "glpi_networkports" and "glpi_plugin_ocsinventoryng_networkports" table based on "networkports_id" field cannot be handled automatically as "networkports_id" also corresponds to index field of the target table. in /var/www/glpi/src/DbUtils.php at line 2099
While the first 2 can be contributed to the fact I haven't defined OCSI servers yet, it should still be handled more elegant :-) Next to that, the last one seems something that certainly needs fixing ...
Hello have you found a solution ?
Haven't investigated further. Also it seems nobody of the devs is reacting in any way, and the main glpi dev-guys don't bother as well. Too bad, but it seems the plugins are being neglected a lot in my opinion.
Sorry, I don't have much time at the moment. Moreover I'm not the original developer, I Just forked the plugin to be able to use It on glpi 10. We've not upgraded our instance, yet.
I'm guessing the indexes need to be named differently for ocsi: the index names seem to collide with those of regular glpi prefixing them with 'ocsi_' or so might already be sufficient.
Is there any way to fix this error? Or offer a solution.
Have you tried to set index networkports_id as non unique ?
Hi, about the same problem for me.
config : Debian 12 - OCS 2.10 - GLPI 10.0.11
PHP Warning: Relation between "glpi_networkports" and "glpi_plugin_ocsinventoryng_networkports" table based on "networkports_id" field cannot be handled automatically as "networkports_id" also corresponds to index field of the target table. in /.../.../DbUtils.php on line 2154
This Threads may help :
- https://github.com/pluginsGLPI/ocsinventoryng/issues/362
- https://github.com/pluginsGLPI/ocsinventoryng/issues/371
Latest commit 8433a48 fix the issue, download it from here : https://github.com/pluginsGLPI/ocsinventoryng/archive/8433a4822d7693619981adfcd0c5a934633a55ec.zip
Creation of dynamic property PluginOcsinventoryngOcsDbClient::$dbname is deprecated in /var/www/html/plugins/ocsinventoryng/inc/ocsdbclient.class.php at line 55