ocsinventoryng icon indicating copy to clipboard operation
ocsinventoryng copied to clipboard

PHP User Warning when GLPI user is deleted

Open emilfazzi opened this issue 1 year ago • 2 comments

The reported PHP Warning appears when deleting a GLPI user.

  • Plugin version: 2.0.4
  • GLPI version: 10.0.7

How to reproduce

  • Create a GLPI user
  • Put the user in trashbin
  • Delete permanently the user from trashbin

PHP error log in glpi/files/_log/php-errors.log contains:

[2023-04-14 10:26:53] 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 /usr/share/glpi/src/DbUtils.php at line 2099
  Backtrace :
  src/DbUtils.php:2099                               trigger_error()
  inc/db.function.php:585                            DbUtils->getDbRelations()
  src/CommonDBTM.php:866                             getDbRelations()
  src/CommonDBTM.php:788                             CommonDBTM->cleanRelationData()
  src/CommonDBTM.php:2064                            CommonDBTM->deleteFromDB()
  src/CommonDBConnexity.php:127                      CommonDBTM->delete()
  src/CommonDBTM.php:986                             CommonDBConnexity->cleanDBonItemDelete()
  src/User.php:437                                   CommonDBTM->deleteChildrenAndRelationsFromDb()
  src/CommonDBTM.php:783                             User->cleanDBonPurge()
  src/CommonDBTM.php:2064                            CommonDBTM->deleteFromDB()
  src/MassiveAction.php:1495                         CommonDBTM->delete()
  src/MassiveAction.php:1408                         MassiveAction::processMassiveActionsForOneItemtype()
  src/MassiveAction.php:1386                         MassiveAction->processForSeveralItemtypes()
  front/massiveaction.php:59                         MassiveAction->process()
  
[2023-04-14 10:26:53] 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 /usr/share/glpi/src/DbUtils.php at line 2099
  Backtrace :
  src/DbUtils.php:2099                               trigger_error()
  inc/db.function.php:585                            DbUtils->getDbRelations()
  src/CommonDBTM.php:866                             getDbRelations()
  src/CommonDBTM.php:788                             CommonDBTM->cleanRelationData()
  src/CommonDBTM.php:2064                            CommonDBTM->deleteFromDB()
  src/MassiveAction.php:1495                         CommonDBTM->delete()
  src/MassiveAction.php:1408                         MassiveAction::processMassiveActionsForOneItemtype()
  src/MassiveAction.php:1386                         MassiveAction->processForSeveralItemtypes()
  front/massiveaction.php:59                         MassiveAction->process()

emilfazzi avatar Apr 14 '23 12:04 emilfazzi

Similar issue: https://github.com/pluginsGLPI/ocsinventoryng/issues/355

kabassanov avatar Jun 09 '23 16:06 kabassanov

Ciao @emilfazzi, the commit 8433a4822d7693619981adfcd0c5a934633a55ec by @tsmr should resolve this. However, the very similar #355 seems not to be solved.

Mirkk avatar Nov 22 '23 16:11 Mirkk