From d10dd0b6ed2832f71234f68087a887a144ee6860 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 8 Jul 2014 17:35:14 +0000 Subject: [PATCH] Fix chosen going crazy in filters by removing unwanted 'No fields' label. Every selectbox (chosen) was binding to the one label, so any click in that area tried to open them all --- .../inc/class.importexport_widget_filter.inc.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/importexport/inc/class.importexport_widget_filter.inc.php b/importexport/inc/class.importexport_widget_filter.inc.php index bf44aaf5c2..3a4a6b80d7 100644 --- a/importexport/inc/class.importexport_widget_filter.inc.php +++ b/importexport/inc/class.importexport_widget_filter.inc.php @@ -48,8 +48,6 @@ class importexport_widget_filter extends etemplate_widget_transformer unset($value['fields']); $relative_dates = $this->attrs['relative_dates']; - $this->setElementAttribute($form_name, 'prefix', self::$prefix); - // Fallback, so there's something there... if(!is_array($fields)) { @@ -60,6 +58,12 @@ class importexport_widget_filter extends etemplate_widget_transformer ); return parent::beforeSendToClient($cname); } + + // Need to clear this if it's not needed. It causes Chosen selectboxes + // to bind to this label. + self::$transformation['label'] = ''; + + $this->setElementAttribute($form_name, 'prefix', self::$prefix); $n = 1; foreach($fields as $lname => &$field) @@ -138,7 +142,7 @@ class importexport_widget_filter extends etemplate_widget_transformer } else { -error_log('Trying to filter with unsupported field type: ' . $field['type']); + error_log('Trying to filter with unsupported field type: ' . $field['type']); } }