Skip to content

Commit

Permalink
[savedObject] always attach an index pattern to searchSources
Browse files Browse the repository at this point in the history
  • Loading branch information
Spencer Alger committed Oct 3, 2014
1 parent c00d86b commit aca2457
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/kibana/components/courier/saved_object/saved_object.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,6 @@ define(function (require) {
} catch (e) {}
obj.searchSource.set(state);
}

if (_.isString(obj.searchSource.get('index'))) {
return indexPatterns.get(obj.searchSource.get('index'))
.then(function (indexPattern) {
obj.searchSource.index(indexPattern);
});
}
})
.then(function () {
return Promise.cast(afterESResp.call(obj, resp));
Expand All @@ -137,6 +130,14 @@ define(function (require) {
});
});
})
.then(function () {
if (obj.searchSource) {
return indexPatterns.get(obj.searchSource.get('index'))
.then(function (indexPattern) {
obj.searchSource.index(indexPattern);
});
}
})
.then(function () {
return customInit.call(obj);
})
Expand Down

0 comments on commit aca2457

Please sign in to comment.