Skip to content

Commit

Permalink
Fix SQL error when items linked to a ticket doesn't support entities
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrienClairembault committed Oct 31, 2024
1 parent d92e54e commit 25aa296
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/CommonDBRelation.php
Original file line number Diff line number Diff line change
Expand Up @@ -2126,7 +2126,12 @@ public static function countForMainItem(CommonDBTM $item, $extra_types_where = [
continue;
}

$params = static::getTypeItemsQueryParams($item->fields['id'], $data['itemtype']);
$linked_item = getItemForItemtype($data['itemtype']);
$params = static::getTypeItemsQueryParams(
$item->fields['id'],
$data['itemtype'],
$linked_item->isEntityAssign(),
);
unset($params['SELECT']);
$params['COUNT'] = 'cpt';
$iterator = $DB->request($params);
Expand Down

0 comments on commit 25aa296

Please sign in to comment.