فهرست منبع

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

Seuf 7 سال پیش
والد
کامیت
1888708ca5
1فایلهای تغییر یافته به همراه3 افزوده شده و 0 حذف شده
  1. 3 0
      public/app/features/templating/template_srv.ts

+ 3 - 0
public/app/features/templating/template_srv.ts

@@ -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) + '"';
     });