Commit 1888708c by Seuf Committed by Torkel Ödegaard

Templating : return __empty__ value when all value return nothing to prevent…

Templating : return __empty__ value when all value return nothing to prevent elasticsearch syntaxe error (#9701)
parent bdb736a9
...@@ -74,6 +74,9 @@ export class TemplateSrv { ...@@ -74,6 +74,9 @@ export class TemplateSrv {
if (typeof value === 'string') { if (typeof value === 'string') {
return luceneEscape(value); return luceneEscape(value);
} }
if (value instanceof Array && value.length === 0) {
return '__empty__';
}
var quotedValues = _.map(value, function(val) { var quotedValues = _.map(value, function(val) {
return '"' + luceneEscape(val) + '"'; return '"' + luceneEscape(val) + '"';
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment