Hello,
I found a bug in the last version of the plugin WebServices. My Glpi
version is 0.85.4.

The itemtype and items_id are searched in the glpi_tickets table instead of
glpi_items_tickets table.

I fixed with this patch (aroung line 1560 in methodhelpdesk.class.php):
      if (isset($params['itemtype'])) {
         if (!empty($params['itemtype']) &&
!class_exists($params['itemtype'])) {
            return self::Error($protocol, WEBSERVICES_ERROR_BADPARAMETER,
'', 'itemtype');
         }
         $join .= "INNER JOIN `glpi_items_tickets`
                         ON (`glpi_tickets`.`id` =
`glpi_items_tickets`.`tickets_id` ) ";

         $where .= " AND `glpi_items_tickets`.`itemtype`='" .
$params['itemtype'] . "'";
      }

      if (isset($params['item'])) {
         if (!isset($params['itemtype'])) {
            return self::Error($protocol,
WEBSERVICES_ERROR_MISSINGPARAMETER, '','itemtype');
         }
         if (!is_numeric($params['item']) || $params['item'] <= 0) {
            return self::Error($protocol, WEBSERVICES_ERROR_BADPARAMETER,
'', 'item');
         }
         $where .= " AND `glpi_items_tickets`.`items_id`='" .
$params['item'] . "'";
      }

Best regards, Fred
_______________________________________________
Glpi-dev mailing list
Glpi-dev@gna.org
https://mail.gna.org/listinfo/glpi-dev

Reply via email to