From 57578ec2cd937bdd1a2f777fad1da08bde05a6f9 Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Tue, 16 Feb 2021 15:59:08 +0100 Subject: [PATCH] fix(glpiselectfield): comparisons need to properly find the itemtype Signed-off-by: Thierry Bugier --- inc/field/glpiselectfield.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/field/glpiselectfield.class.php b/inc/field/glpiselectfield.class.php index 2d2bf0716..1631cfa35 100644 --- a/inc/field/glpiselectfield.class.php +++ b/inc/field/glpiselectfield.class.php @@ -221,7 +221,7 @@ public function getAvailableValues(): array { public function equals($value): bool { $value = html_entity_decode($value); - $itemtype = $this->question->fields['values']; + $itemtype = $this->getSubItemtypeForValues($this->question->fields['values']); $item = new $itemtype(); if ($item->isNewId($this->value)) { return ($value === ''); @@ -238,7 +238,7 @@ public function notEquals($value): bool { public function greaterThan($value): bool { $value = html_entity_decode($value); - $itemtype = $this->question->fields['values']; + $itemtype = $this->getSubItemtypeForValues($this->question->fields['values']); $item = new $itemtype(); if (!$item->getFromDB($this->value)) { throw new ComparisonException('Item not found for comparison');