From babd80dfd1e35f1851d03ea1c112681a7061fbbe Mon Sep 17 00:00:00 2001 From: David Taylor Date: Fri, 8 Feb 2019 12:58:10 +0000 Subject: [PATCH] FIX: Allow subexpressions in raw handlebars helpers Helpers registered via `registerUnbound` did not receive parameters if they were subexpressions. For example: `{{helper1 key=(helper2 value)}}` --- app/assets/javascripts/discourse-common/lib/helpers.js.es6 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse-common/lib/helpers.js.es6 b/app/assets/javascripts/discourse-common/lib/helpers.js.es6 index bbaaf6200a1..907ae24d8c9 100644 --- a/app/assets/javascripts/discourse-common/lib/helpers.js.es6 +++ b/app/assets/javascripts/discourse-common/lib/helpers.js.es6 @@ -32,7 +32,11 @@ function resolveParams(ctx, options) { if (options.hashTypes) { Object.keys(hash).forEach(function(k) { const type = options.hashTypes[k]; - if (type === "STRING" || type === "StringLiteral") { + if ( + type === "STRING" || + type === "StringLiteral" || + type === "SubExpression" + ) { params[k] = hash[k]; } else if (type === "ID" || type === "PathExpression") { params[k] = get(ctx, hash[k], options);