diff --git a/core/modules/widgets/widget.js b/core/modules/widgets/widget.js index b38397749..b7780e069 100755 --- a/core/modules/widgets/widget.js +++ b/core/modules/widgets/widget.js @@ -342,7 +342,15 @@ Widget.prototype.makeFakeWidgetWithVariables = function(variables) { makeFakeWidgetWithVariables: self.makeFakeWidgetWithVariables, resolveVariableParameters: self.resolveVariableParameters, wiki: self.wiki, - variables: variables, + get variables() { + // We have to inefficiently fake the variables hashmap. It would be better to refactor the places + // that make direct access to the variables hashmap + const v = Object.create(self.parentWidget.variables || null); + $tw.utils.each(variables,function(value,name) { + v[name] = {value: value}; + }); + return v; + }, getAncestorCount: function() { return 0; }