From 777e1bec1e48ba72861255ca9f4ebaaa5489930f Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 12 May 2014 22:16:05 +0000 Subject: [PATCH] Better handling for detached label, fixes errors if there is no label --- etemplate/inc/class.nextmatch_widget.inc.php | 2 +- etemplate/js/et2_widget_link.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/etemplate/inc/class.nextmatch_widget.inc.php b/etemplate/inc/class.nextmatch_widget.inc.php index 2dceb85f08..520f32c090 100644 --- a/etemplate/inc/class.nextmatch_widget.inc.php +++ b/etemplate/inc/class.nextmatch_widget.inc.php @@ -788,7 +788,7 @@ class nextmatch_widget if($none_option) { array_unshift($cats, array( - 'id' => '', + 'id' => $prefix.'', 'name' => 'None' )); } diff --git a/etemplate/js/et2_widget_link.js b/etemplate/js/et2_widget_link.js index 9c0bd257e5..50a4512cee 100644 --- a/etemplate/js/et2_widget_link.js +++ b/etemplate/js/et2_widget_link.js @@ -1325,6 +1325,13 @@ var et2_link_string = et2_valueWidget.extend([et2_IDetachedDOM], * passed to the "setDetachedAttributes" function in the same order. */ getDetachedNodes: function() { + // Create the label container if it didn't exist yet + if (this._labelContainer == null) + { + this._labelContainer = $j(document.createElement("label")) + .addClass("et2_label"); + this.getSurroundings().insertDOMNode(this._labelContainer[0]); + } return [this.list[0], this._labelContainer[0]]; },