Skip to content

Commit

Permalink
fix(issue): compatibility with search engine of GLPI 9.4
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Jan 29, 2019
1 parent 746326c commit 65a48fe
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions inc/issue.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,14 @@ public static function giveItem($itemtype, $option_id, $data, $num) {
$table = $searchopt[$option_id]["table"];
$field = $searchopt[$option_id]["field"];

if (isset($data['raw']['ITEM_0_display_id'])) {
if (version_compare(GLPI_VERSION, '9.4') < 0) {
$rawColumn = 'ITEM_0_display_id';
} else {
$rawColumn = 'ITEM_PluginFormcreatorIssue_1_display_id';
}
if (isset($data['raw'][$rawColumn])) {
$matches = null;
preg_match('/[tf]+_([0-9]*)/', $data['raw']['ITEM_0_display_id'], $matches);
preg_match('/[tf]+_([0-9]*)/', $data['raw'][$rawColumn], $matches);
$id = $matches[1];
}

Expand Down

0 comments on commit 65a48fe

Please sign in to comment.