From dfd9764e1294e400663c7669425f64112a8ee8a8 Mon Sep 17 00:00:00 2001 From: raviks789 Date: Fri, 16 May 2025 15:12:22 +0200 Subject: [PATCH] IcingaServiceForm: Support `apply for` rule for instantiable dictionary and array --- application/forms/IcingaServiceForm.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/application/forms/IcingaServiceForm.php b/application/forms/IcingaServiceForm.php index d5045147..9abb9dc8 100644 --- a/application/forms/IcingaServiceForm.php +++ b/application/forms/IcingaServiceForm.php @@ -628,8 +628,7 @@ class IcingaServiceForm extends DirectorObjectForm ] ) ->join(['iop' => 'icinga_host_property'], 'dp.uuid = iop.property_uuid', []) - ->where("value_type = 'array' AND instantiable = 'y'") - ->orWhere("value_type = 'dict'"); + ->where("value_type IN ('array', 'dict') AND instantiable = 'y'"); $vars = $this->db->getDbAdapter()->fetchAll($query); @@ -659,7 +658,7 @@ class IcingaServiceForm extends DirectorObjectForm 'all objects with the custom attribute specified. ' . 'E.g selecting "host.vars.custom_attr" will generate "for (config in ' . 'host.vars.array_var)" where "config" will be accessible through "$config$". ' . - 'NOTE: only custom variables of type "Array" are eligible.' + 'NOTE: only custom variables of type "Array" and "Dictionary" are eligible.' ) )); }