From 0b11b499c27da317ee803543e768847612ad1e27 Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Tue, 10 May 2022 10:21:56 +0100 Subject: [PATCH] Better backwards compatibility for legacy recursion marker Fixes the problem with tag dropdowns @btheado --- core/modules/widgets/transclude.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/core/modules/widgets/transclude.js b/core/modules/widgets/transclude.js index dcb31ad01..384f77ef4 100755 --- a/core/modules/widgets/transclude.js +++ b/core/modules/widgets/transclude.js @@ -63,15 +63,18 @@ TranscludeWidget.prototype.execute = function() { break; } // Set context variables for recursion detection - var recursionMarker = this.makeLegacyRecursionMarker(), - newRecursionMarker = this.makeRecursionMarker(); + var recursionMarker = this.makeRecursionMarker(); if(this.recursionMarker === "yes") { - this.setVariable("transclusion",recursionMarker); - this.setVariable("$transclusion",newRecursionMarker); + this.setVariable("$transclusion",recursionMarker); + } + // Set the legacy transclusion context variables only if we're not transcluding a variable + if(!this.transcludeVariable) { + var legacyRecursionMarker = this.makeLegacyRecursionMarker(); + this.setVariable("transclusion",legacyRecursionMarker); } // Check for recursion if(target.parser) { - if(this.parentWidget && this.parentWidget.hasVariable("$transclusion",newRecursionMarker)) { + if(this.parentWidget && this.parentWidget.hasVariable("$transclusion",recursionMarker)) { parseTreeNodes = [{type: "element", tag: "span", attributes: { "class": {type: "string", value: "tc-error"} }, children: [