diff --git a/core/modules/filters.js b/core/modules/filters.js index 5f4eb6492..808628acb 100644 --- a/core/modules/filters.js +++ b/core/modules/filters.js @@ -247,8 +247,8 @@ exports.compileFilter = function(filterString) { // Use the "title" operator if no operator is specified operatorFunction = filterOperators.title; } else if(!filterOperators[operator.operator]) { - // Unknown operators treated as "unknown" - at run time we can distinguish between a custom operator and falling back to the default "field" operator - operatorFunction = filterOperators.unknown; + // Unknown operators treated as "[unknown]" - at run time we can distinguish between a custom operator and falling back to the default "field" operator + operatorFunction = filterOperators["[unknown]"]; } else { // Use the operator function operatorFunction = filterOperators[operator.operator]; diff --git a/core/modules/filters/unknown.js b/core/modules/filters/unknown.js index c2e2912a4..2eca09a7c 100644 --- a/core/modules/filters/unknown.js +++ b/core/modules/filters/unknown.js @@ -3,7 +3,9 @@ title: $:/core/modules/filters/unknown.js type: application/javascript module-type: filteroperator -Filter operator for handling unknown filter operators +Filter operator for handling unknown filter operators. + +Not intended to be used directly by end users, hence the square brackets around the name. \*/ (function(){ @@ -17,7 +19,7 @@ var fieldFilterOperatorFn = require("$:/core/modules/filters/field.js").field; /* Export our filter function */ -exports.unknown = function(source,operator,options) { +exports["[unknown]"] = function(source,operator,options) { var customDefinitionTitle = "[" + operator.operator + "[]]", customDefinition = options.widget && options.widget.getVariableInfo && options.widget.getVariableInfo(customDefinitionTitle); if(customDefinition && customDefinition.srcVariable && customDefinition.srcVariable.isFunctionDefinition) {