diff --git a/inc/condition.class.php b/inc/condition.class.php index 3f4821395..0308c813b 100644 --- a/inc/condition.class.php +++ b/inc/condition.class.php @@ -213,7 +213,7 @@ public function getConditionsFromItem(CommonDBTM $item) { 'SELECT' => ['id'], 'FROM' => self::getTable(), 'WHERE' => [ - 'itemtype' => get_class($item), + 'itemtype' => $item->getType(), 'items_id' => $item->getID() ], 'ORDER' => 'order ASC' @@ -243,7 +243,7 @@ public function showConditionsForItem(CommonDBTM $item) { $this->getEnumShowRule(), [ 'value' => $item->fields['show_rule'], - 'on_change' => 'plugin_formcreator_toggleCondition(this, "' . $item->getType() . '");', + 'on_change' => 'plugin_formcreator_toggleCondition(this);', 'rand' => $rand, ] );