Skip to content

Commit 66efc19

Browse files
fix(container): correct entity ID and add 'use Glpi\DBAL\QueryExpression'
1 parent be9249e commit 66efc19

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

inc/container.class.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
* -------------------------------------------------------------------------
2929
*/
3030

31+
use Glpi\DBAL\QueryExpression;
32+
3133
class PluginFieldsContainer extends CommonDBTM
3234
{
3335
use Glpi\Features\Clonable;
@@ -1715,13 +1717,13 @@ public static function findContainers($itemtype, $type = 'tab', $subtype = '', $
17151717
return [];
17161718
}
17171719

1718-
$entitiesIds = getAncestorsOf("glpi_entities", (string) $entityId);
1720+
$entitiesIds = getAncestorsOf("glpi_entities", (int) $entityId);
17191721
$entitiesIds[] = $entityId; // Add entity active itself to the list
17201722

17211723
$where = [
17221724
'is_active' => 1,
17231725
'type' => $type,
1724-
new \QueryExpression("JSON_CONTAINS(itemtypes, " . $DB->quote('"' . $itemtype . '"') . ")"),
1726+
new QueryExpression("JSON_CONTAINS(itemtypes, " . $DB->quote('"' . $itemtype . '"') . ")"),
17251727
'AND' => [
17261728
'OR' => [
17271729
[

0 commit comments

Comments
 (0)