Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save colepacak/90f3dfd5040dd6233957feb3b0eb36dd to your computer and use it in GitHub Desktop.
Save colepacak/90f3dfd5040dd6233957feb3b0eb36dd to your computer and use it in GitHub Desktop.
Chosen Ajax - Check if chosen is enabled
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