From 051c5540c9195a3325b7bdf77908a70ebe1193b9 Mon Sep 17 00:00:00 2001 From: Matthew Bargar Date: Wed, 12 Oct 2016 11:25:15 -0400 Subject: [PATCH] Avoid printing notify object in lang selector on error When ES is unavailable and we can't get the list of enabled scripting langs we display a notification to the user. We were also accidentally returning that notification object from the service method and displaying its toString representation in the language select drop down. Now we simplay return an empty array so the dropdown is rendered without options. Fixes https://github.com/elastic/kibana/issues/8636 --- src/ui/public/field_editor/field_editor.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ui/public/field_editor/field_editor.js b/src/ui/public/field_editor/field_editor.js index 02a257b81644d..224d94760e4e7 100644 --- a/src/ui/public/field_editor/field_editor.js +++ b/src/ui/public/field_editor/field_editor.js @@ -161,7 +161,8 @@ uiModules return $http.get(chrome.addBasePath('/api/kibana/scripts/languages')) .then((res) => res.data) .catch(() => { - return notify.error('Error getting available scripting languages from Elasticsearch'); + notify.error('Error getting available scripting languages from Elasticsearch'); + return []; }); }