Last active
September 26, 2016 20:21
-
-
Save colepacak/90f3dfd5040dd6233957feb3b0eb36dd to your computer and use it in GitHub Desktop.
Chosen Ajax - Check if chosen is enabled
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/chosen_ajax.module b/chosen_ajax.module | |
index 5b2f460..c0cf4ba 100644 | |
--- a/chosen_ajax.module | |
+++ b/chosen_ajax.module | |
@@ -109,7 +109,7 @@ function chosen_ajax_field_widget_form_alter(&$element, &$form_state, $context) | |
* Helper function to update element recursively. | |
*/ | |
function chosen_ajax_field_widget_apply_recursive(&$element, $settings) { | |
- if (isset($element['#chosen'])) { | |
+ if (!empty($element['#chosen']) && $element['#chosen']) { | |
if (isset($element['#type']) && $element['#type'] == 'textfield') { | |
$element['#chosen_ajax'] = array( | |
'options' => array( |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment