pluginsGLPI / ocsinventoryng

Plugin ocsinventoryng for GLPI
GNU General Public License v2.0
68 stars 52 forks source link

PHP warning with 10.0.7 #361

Open liedekef opened 1 year ago

liedekef commented 1 year ago

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 ...

jlb5980 commented 1 year ago

Hello have you found a solution ?

liedekef commented 1 year ago

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.

jackburton79 commented 1 year ago

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.

liedekef commented 1 year ago

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.

Roland-GoIT commented 10 months ago

Is there any way to fix this error? Or offer a solution.

jmichault commented 7 months ago

Have you tried to set index networkports_id as non unique ?

tontonrico commented 7 months ago

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

roms2000 commented 4 months ago

This Threads may help :

Latest commit 8433a48 fix the issue, download it from here : https://github.com/pluginsGLPI/ocsinventoryng/archive/8433a4822d7693619981adfcd0c5a934633a55ec.zip

Roland-GoIT commented 4 months ago

Creation of dynamic property PluginOcsinventoryngOcsDbClient::$dbname is deprecated in /var/www/html/plugins/ocsinventoryng/inc/ocsdbclient.class.php at line 55