From db3887d09ef9d632fd5d5a382a5ec5ef7681cb59 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Sat, 1 Nov 2014 06:39:21 +0100 Subject: [PATCH] Make the 'name' attribute available in object definitions fixes #7538 --- lib/config/configitem.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/config/configitem.cpp b/lib/config/configitem.cpp index 5d51fd5cf..1ccec6ce3 100644 --- a/lib/config/configitem.cpp +++ b/lib/config/configitem.cpp @@ -126,12 +126,16 @@ Dictionary::Ptr ConfigItem::GetProperties(void) ObjectLock olock(this); if (!m_Properties) { + Dictionary::Ptr locals = make_shared(); + locals->Set("__parent", m_Scope); + locals->Set("name", m_Name); + DebugHint dhint; m_Properties = make_shared(); m_Properties->Set("type", m_Type); if (!m_Zone.IsEmpty()) m_Properties->Set("zone", m_Zone); - m_Properties->Set("__parent", m_Scope); + m_Properties->Set("__parent", locals); GetExpressionList()->Evaluate(m_Properties, &dhint); m_Properties->Remove("__parent"); m_DebugHints = dhint.ToDictionary(); -- 2.40.0