From 3edcc31e19904deff6b75899756f4caeeec2ac86 Mon Sep 17 00:00:00 2001 From: Stanislas Date: Tue, 14 Jan 2025 09:21:18 +0100 Subject: [PATCH] Fix(Condition): Fix display when value is no more available --- CHANGELOG.md | 2 ++ inc/containerdisplaycondition.class.php | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d259ad13..d5abf8a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [UNRELAESE] +- Fix `PluginFieldsContainerDisplayCondition` display when value is no more available. + ## [1.21.17] - 2024-12-26 ### Fixed diff --git a/inc/containerdisplaycondition.class.php b/inc/containerdisplaycondition.class.php index 5d20bb71..eba2a041 100644 --- a/inc/containerdisplaycondition.class.php +++ b/inc/containerdisplaycondition.class.php @@ -313,8 +313,9 @@ public static function getRawValue($searchoption_id, $itemtype, $value) if ($so['datatype'] == 'dropdown' || ($so['datatype'] == 'itemlink' && $so['table'] !== $itemtypetable)) { $dropdown_itemtype = getItemTypeForTable($so['table']); $dropdown = new $dropdown_itemtype(); - $dropdown->getFromDB($value); - $raw_value = $dropdown->fields['name']; + if ($dropdown->getFromDB($value)) { + $raw_value = $dropdown->fields['name']; + } } elseif ($so['datatype'] == 'specific' && get_parent_class($itemtype) == CommonITILObject::getType()) { switch ($so['field']) { case 'status':