[icinga-checkins] icinga.org: icinga2/master: Fix incorrect variable names for joined fields in filter expressions

git at icinga.org git at icinga.org
Thu May 12 10:24:34 CEST 2016


Module: icinga2
Branch: master
Commit: de1b70cf44775adcd48ee44ea7f2289719af8269
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=de1b70cf44775adcd48ee44ea7f2289719af8269

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Thu May 12 10:24:15 2016 +0200

Fix incorrect variable names for joined fields in filter expressions

fixes #11779

---

 lib/remote/filterutility.cpp |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/remote/filterutility.cpp b/lib/remote/filterutility.cpp
index d5e8cd1..d9f50e7 100644
--- a/lib/remote/filterutility.cpp
+++ b/lib/remote/filterutility.cpp
@@ -123,7 +123,10 @@ bool FilterUtility::EvaluateFilter(ScriptFrame& frame, Expression *filter,
 
 		Object::Ptr joinedObj = target->NavigateField(fid);
 
-		vars->Set(field.Name, joinedObj);
+		if (field.NavigationName)
+			vars->Set(field.NavigationName, joinedObj);
+		else
+			vars->Set(field.Name, joinedObj);
 	}
 
 	return Convert::ToBool(filter->Evaluate(frame));



More information about the icinga-checkins mailing list