Browse Source

Fixed bug in form_alter that was preventing some fields from appearing

Stephen Ficklin 7 years ago
parent
commit
486fd56b57
1 changed files with 6 additions and 0 deletions
  1. 6 0
      tripal/tripal.module

+ 6 - 0
tripal/tripal.module

@@ -660,6 +660,12 @@ function tripal_form_alter(&$form, $form_state, $form_id) {
             if (array_key_exists('value', $element) and $element['value']['#type'] == 'value') {
               $total_widgets--;
             }
+            // Some form elements don't have a 'value' and they don't have any
+            // widgets (i.e image field and description field. We don't
+            // want to loose those, so add one to the widget count.
+            if (!array_key_exists('value', $element)) {
+              $total_widgets++;
+            }
           }
         }
         // If we have no widgets then here's not a form for this field so just