From df1f6b2ff45746aa4fcd00f927ffe82807964a9b Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 16 Apr 2012 23:13:48 +0000 Subject: [PATCH] Fix single values --- etemplate/js/et2_widget_link.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/etemplate/js/et2_widget_link.js b/etemplate/js/et2_widget_link.js index e0069288f5..e6e0434150 100644 --- a/etemplate/js/et2_widget_link.js +++ b/etemplate/js/et2_widget_link.js @@ -841,7 +841,10 @@ var et2_link_string = et2_valueWidget.extend([et2_IDetachedDOM], { set_value: function(_value) { // Get data if(!_value || _value == null) return; - if(!_value.to_app && this.options.application) _value.to_app = this.options.application; + if(!_value.to_app && typeof _value == "object" && this.options.application) + { + _value.to_app = this.options.application; + } if(typeof _value == 'object' && _value.to_app && _value.to_id) { @@ -849,7 +852,7 @@ var et2_link_string = et2_valueWidget.extend([et2_IDetachedDOM], { this._get_links(); return; } - if(_value.length > 0) { + if(typeof _value == 'object' && _value.length > 0) { // Have full info // Don't store new value, just update display @@ -864,6 +867,10 @@ var et2_link_string = et2_valueWidget.extend([et2_IDetachedDOM], { } } } + else if(this.options.application) + { + this._add_link({id:_value, app: this.options.application}); + } }, _get_links: function() {