Skip to content

Commit

Permalink
fix(glpiselectfield): comparisons need to properly find the itemtype
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Feb 16, 2021
1 parent 70896c9 commit 57578ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inc/field/glpiselectfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 === '');
Expand All @@ -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');
Expand Down

0 comments on commit 57578ec

Please sign in to comment.