Skip to content

Commit 57578ec

Browse files
committed
fix(glpiselectfield): comparisons need to properly find the itemtype
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
1 parent 70896c9 commit 57578ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

inc/field/glpiselectfield.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ public function getAvailableValues(): array {
221221

222222
public function equals($value): bool {
223223
$value = html_entity_decode($value);
224-
$itemtype = $this->question->fields['values'];
224+
$itemtype = $this->getSubItemtypeForValues($this->question->fields['values']);
225225
$item = new $itemtype();
226226
if ($item->isNewId($this->value)) {
227227
return ($value === '');
@@ -238,7 +238,7 @@ public function notEquals($value): bool {
238238

239239
public function greaterThan($value): bool {
240240
$value = html_entity_decode($value);
241-
$itemtype = $this->question->fields['values'];
241+
$itemtype = $this->getSubItemtypeForValues($this->question->fields['values']);
242242
$item = new $itemtype();
243243
if (!$item->getFromDB($this->value)) {
244244
throw new ComparisonException('Item not found for comparison');

0 commit comments

Comments
 (0)