fix: nested functions should resolve filter run variables (#8233)

This commit is contained in:
Saq Imtiaz
2024-06-04 19:19:41 +02:00
committed by GitHub
parent 4860b14315
commit 33bc77f46f
2 changed files with 24 additions and 2 deletions

View File

@@ -316,7 +316,8 @@ Widget.prototype.getStateQualifier = function(name) {
Make a fake widget with specified variables, suitable for variable lookup in filters
*/
Widget.prototype.makeFakeWidgetWithVariables = function(variables) {
var self = this;
var self = this,
variables = variables || {};
return {
getVariable: function(name,opts) {
if($tw.utils.hop(variables,name)) {
@@ -334,7 +335,7 @@ Widget.prototype.makeFakeWidgetWithVariables = function(variables) {
};
} else {
opts = opts || {};
opts.variables = variables;
opts.variables = $tw.utils.extend(variables,opts.variables);
return self.getVariableInfo(name,opts);
};
},