From 4b655bf542f01f2d1a386b5649e0067885429594 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Fri, 26 Sep 2014 11:19:25 +0000 Subject: [PATCH] Make sure there's an app set, otherwise set it from top of the list --- etemplate/js/et2_widget_link.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/etemplate/js/et2_widget_link.js b/etemplate/js/et2_widget_link.js index ea31be0041..ef606eebff 100644 --- a/etemplate/js/et2_widget_link.js +++ b/etemplate/js/et2_widget_link.js @@ -754,6 +754,11 @@ var et2_link_entry = et2_inputWidget.extend( if(typeof this.options.value == 'object' && !this.options.value.app) { this.options.value.app = egw.preference('link_app',this.options.value.to_app || this.egw().getAppName()); + // If there's no value set for app, then take the first one from the selectbox + if (typeof this.options.value.app == 'undefined' || this.options.value.app) + { + this.options.value.app = Object.keys(this.options.select_options)[0]; + } this.app_select.val(this.options.value.app); } return this._super.apply(this,arguments);