From 816eb61313e087078dbf8594a408fb13f3a285cc Mon Sep 17 00:00:00 2001 From: Bharat Dandu Date: Fri, 31 Mar 2023 15:14:48 -0400 Subject: [PATCH] Using ../ when the partial with arguments is inside an if case which is under a block helper does not make it retrieve the parent context. However using parent. within the same if case retrieves the parent block helper's context. It is weird that ../ and parent. are not behaving the same way inside an inline partial with arguments. Therefore moving the inline outside the if case and switching back to ../manufacturerCode and ../code instead of ../../manufacturerCode and ../../code Github: ZAP#971 --- src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt b/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt index 7c5d275e70fc6e..84537e0b9ec8e7 100644 --- a/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt +++ b/src/darwin/Framework/CHIP/templates/MTRClusters-src.zapt @@ -60,7 +60,6 @@ static void MTRClustersLogCompletion(NSString *logPrefix, id value, NSError *err } {{#zcl_commands}} -{{#if (is_str_equal source 'client')}} {{! Takes two arguments: cluster name and command name, plus the ambient state where the command is "this" }} {{#*inline "commandImpl"}} {{! This is used as the implementation for both the new-name and old-name bits, so check for both here. }} @@ -76,7 +75,7 @@ MTR{{cluster}}Cluster{{command}}Params {{/inline}} {{#*inline "clusterId"}} {{#if (wasRemoved cluster command=command)}} -{{asMEI ../../manufacturerCode ../../code}} +{{asMEI ../manufacturerCode ../code}} {{else}} MTRClusterIDType{{cluster}}ID {{/if}} @@ -179,6 +178,7 @@ MTRCommandIDTypeCluster{{cluster}}Command{{command}}ID } {{/unless}} {{/inline}} +{{#if (is_str_equal source 'client')}} {{> commandImpl cluster=(asUpperCamelCase parent.name preserveAcronyms=true) command=(asUpperCamelCase name preserveAcronyms=true)}} {{/if}}