Templating : return __empty__ value when all value return nothing to prevent elasticsearch syntaxe error (#9701)

This commit is contained in:
Seuf 2018-05-08 14:04:20 +02:00 committed by Torkel Ödegaard
parent bdb736a9ee
commit 1888708ca5

View File

@ -74,6 +74,9 @@ export class TemplateSrv {
if (typeof value === 'string') {
return luceneEscape(value);
}
if (value instanceof Array && value.length === 0) {
return '__empty__';
}
var quotedValues = _.map(value, function(val) {
return '"' + luceneEscape(val) + '"';
});