Bug #5574
Bug to use with GLPi API
Status: | Rejected | Start date: | 11/21/2018 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | yllen | % Done: | 0% | |
Category: | - | |||
Target version: | 2.1.2 |
Description
we found a BUG when using Beheviors with the GLPi API.
When the call is opened via API and the requester is required, PLUGIN can not recognize the requester coming via API, blocking the creation of the ticket.
We commend the change to 1 file to correct this error.
File: behaviors / inc / ticket.class.php
we inserted a conditional for the plugin to validate the session.use_cookies = 0 variable and accept it for opening API calls.
Resolution:
in beforeAdd(Ticket $ticket) we created a IF to test API interaction:
static function beforeAdd(Ticket $ticket) {
global $DB;
//this line is new
if (!empty(ini_get('session.use_cookies'))) {
if (!is_array($ticket->input) || !count($ticket->input)) {
// Already cancel by another plugin
return false;
}
$dbu = new DbUtils();
...
...
}
...
...
the file attached
History
#1 Updated by yllen about 2 years ago
Behaviors must read data from api like it reads data from webservices.
You must put correct value in your json, like core done ('_users_id_requester')
#2 Updated by yllen about 2 years ago
- Status changed from New to Rejected