浏览代码

HUE-6791 [search] Protect against pivot facets conflicting with nested facets

Romain Rigaux 8 年之前
父节点
当前提交
c414c67b81
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      desktop/libs/dashboard/src/dashboard/static/dashboard/js/search.ko.js

+ 2 - 2
desktop/libs/dashboard/src/dashboard/static/dashboard/js/search.ko.js

@@ -718,7 +718,7 @@ var Collection = function (vm, collection) {
     }
     if (typeof facet.properties.facets != 'undefined') {
       $.each(facet.properties.facets(), function (index, pivotFacet) {
-        if (pivotFacet.aggregate) {
+        if (pivotFacet.aggregate && pivotFacet.aggregate.function) {
           pivotFacet.aggregate.function.subscribe(function () {
             vm.search();
           });
@@ -2359,7 +2359,7 @@ var SearchViewModel = function (collection_json, query_json, initial_json) {
       }
       if (typeof facet.properties.facets != 'undefined') {
         $.each(facet.properties.facets(), function (index, pivotFacet) {
-          if (pivotFacet.aggregate) {
+          if (pivotFacet.aggregate && pivotFacet.aggregate.function) {
             pivotFacet.aggregate.function.subscribe(function () {
               vm.search();
             });