Bug #4439

Computer Link Rule (glpi v .84 and ocs plugin)

Added by moyo over 6 years ago. Updated over 6 years ago.

Status:ClosedStart date:08/14/2013
Priority:NormalDue date:
Assignee:moyo% Done:

100%

Category:Rules Engines
Target version:0.84.1

Description

see http://www.glpi-project.org/forum/viewtopic.php?pid=163237#p163237

TODO : problème de test de la règle : normal l'entité n'est pas définit car le moteur de règle n'est pas joué. Je ne vois pas de solution.

Première analyse :
ocsservers_id n'est pas définit dans les inputs.
En modifiant plugin_ocsinventoryng_ruleCollectionPrepareInputDataForProcess et en mettant $rule_parameters = array('ocsservers_id' => $ocsservers_id);

on valide bien le critere lié au serveur et on passe alors dans le critère globa mais il refuse l'import à ce moment là.


Related issues

Related to ocsinventoryng - Bug #4438: Computer Link Rule (glpi v .84 and ocs plugin) Closed 08/14/2013
Related to GLPI-PROJECT - Bug #4499: Computer Link Rule (glpi v .84 and ocs plugin) Closed 08/14/2013

Associated revisions

Revision 21519
Added by moyo over 6 years ago

Computer Link Rule (glpi v .84 and ocs plugin) fixed #4439

Revision 21520
Added by moyo over 6 years ago

[0.85] Computer Link Rule (glpi v .84 and ocs plugin) see #4439

History

#1 Updated by moyo over 6 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Applied in changeset r21519.

#2 Updated by moyo over 6 years ago

  • Category set to Rules Engines
  • Assignee set to moyo
  • Target version set to 0.84.1

#3 Updated by moyo over 6 years ago

  • Status changed from Resolved to Assigned
  • % Done changed from 100 to 80

#4 Updated by moyo over 6 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 80 to 100

#5 Updated by kraveda over 6 years ago

I have updated GLPI to version 0.84.1 and ocsinventoryng plugin to version 1.0.2 but bug was not resolved. I have this result after check rule now (Serial number is already present in GLPI - Yes):

PHP Notice: Undefined index: params in /var/www/inc/ruleimportcomputer.class.php at line 312
PHP Notice: Undefined index: params in /var/www/inc/ruleimportcomputer.class.php at line 315
PHP Notice: Trying to get property of non-object in /var/www/inc/dbmysql.class.php at line 252

GLPI php-errors log:

2013-09-13 22:35:03
Notice(8): Undefined index: params
Backtrace :
/var/www/inc/ruleimportcomputer.class.php:315           Toolbox::userErrorHandlerNormal()
/var/www/inc/rule.class.php:1051                RuleImportComputer->findWithGlobalCriteria()
/var/www/inc/rule.class.php:995         Rule->checkCriterias()
/var/www/inc/rulecollection.class.php:695               Rule->process()
/var/www/plugins/ocsinventoryng/inc/ocsserver.class.php:1922            RuleCollection->processAllRules()
/var/www/plugins/ocsinventoryng/inc/ocsserver.class.php:1526            PluginOcsinventoryngOcsServer::importComputer()
/var/www/plugins/ocsinventoryng/scripts/ocsng_fullsync.php:354          PluginOcsinventoryngOcsServer::processComputer()
/var/www/plugins/ocsinventoryng/scripts/ocsng_fullsync.php:286          plugin_ocsinventoryng_importFromOcsServer()
/var/www/plugins/ocsinventoryng/scripts/ocsng_fullsync.php:178          SecondPass()

GLPI sql-errors.log:

2013-09-13 22:35:03
*** MySQL query error:
***
SQL: SELECT `glpi_computers`.`id`
                   FROM `glpi_computers`
                           LEFT JOIN `glpi_plugin_ocsinventoryng_ocslinks`
                              ON (`glpi_computers`.`id` = `glpi_plugin_ocsinventoryng_ocslinks`.`computers_id`)
                   WHERE 1 AND `glpi_computers`.`serial`=\'4063-1097-7273-6766-3844-5597-68\' AND `glpi_plugin_ocsinventoryng_ocslinks`.`computers_id` IS NULL
                             AND `glpi_computers`.`entities_id` IN ()
                             AND `glpi_computers`.`is_template` = \'0\'
                   ORDER BY `glpi_computers`.`is_deleted` ASC
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')
                             AND `glpi_computers`.`is_template` = '0'
       ' at line 6
Backtrace :
/var/www/inc/ruleimportcomputer.class.php :386             DBmysql->query()
/var/www/inc/rule.class.php :1051          RuleImportComputer->findWithGlobalCriteria()
/var/www/inc/rule.class.php :995           Rule->checkCriterias()
/var/www/inc/rulecollection.class.php :695         Rule->process()
/var/www/plugins/ocsinventoryng/inc/ocsserver.class.php :1922              RuleCollection->processAllRules()
/var/www/plugins/ocsinventoryng/inc/ocsserver.class.php :1526              PluginOcsinventoryngOcsServer::importComputer()
/var/www/plugins/ocsinventoryng/scripts/ocsng_fullsync.php :354            PluginOcsinventoryngOcsServer::processComputer()
/var/www/plugins/ocsinventoryng/scripts/ocsng_fullsync.php :286            plugin_ocsinventoryng_importFromOcsServer()
/var/www/plugins/ocsinventoryng/scripts/ocsng_fullsync.php :178            SecondPass()
ocsng_fullsync.php

Sorry if I should not have to post it here.

#6 Updated by moyo over 6 years ago

New ticket created (see related tickets)

Also available in: Atom PDF