From: Gunnar Beutner Date: Fri, 12 Aug 2016 11:32:13 +0000 (+0200) Subject: Fix 'use' keyword for templates X-Git-Tag: v2.5.0~80 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=419500e55e2e5336deeabac78f51d348cea636f1;p=icinga2 Fix 'use' keyword for templates fixes #12409 --- diff --git a/lib/config/expression.cpp b/lib/config/expression.cpp index 7c1807164..14f52ac48 100644 --- a/lib/config/expression.cpp +++ b/lib/config/expression.cpp @@ -751,6 +751,11 @@ ExpressionResult ImportExpression::DoEvaluate(ScriptFrame& frame, DebugHint *dhi if (!item) BOOST_THROW_EXCEPTION(ScriptError("Import references unknown template: '" + name + "'", m_DebugInfo)); + Dictionary::Ptr scope = item->GetScope(); + + if (scope) + scope->CopyTo(frame.Locals); + ExpressionResult result = item->GetExpression()->Evaluate(frame, dhint); CHECK_RESULT(result);