diff --git a/etemplate/js/et2_widget_link.js b/etemplate/js/et2_widget_link.js index 898c9356a3..b355505ee1 100644 --- a/etemplate/js/et2_widget_link.js +++ b/etemplate/js/et2_widget_link.js @@ -1573,11 +1573,11 @@ var et2_link_list = et2_link_string.extend( set_value: function(_value) { + this.list.empty(); // Handle server passed a list of links that aren't ready yet if(_value && typeof _value == "object") { var list = []; - this.list.empty(); if(_value.to_id && typeof _value.to_id == "object") { list = _value.to_id; @@ -1628,7 +1628,7 @@ var et2_link_list = et2_link_string.extend( _add_link: function(_link_data) { var row = $j(document.createElement("tr")) - .attr("id", "link_"+(_link_data.dom_id ? _link_data.dom_id : (typeof _link_data.link_id == "number" ? _link_data.link_id : _link_data.link_id.replace(/[:\.]/g,'_')))) + .attr("id", "link_"+(_link_data.dom_id ? _link_data.dom_id : (typeof _link_data.link_id == "string" ? _link_data.link_id.replace(/[:\.]/g,'_'):_link_data.link_id ||_link_data.id))) .attr("draggable", _link_data.app == 'file' ? "true" : "") .appendTo(this.list); if(!_link_data.link_id)