Browse Source

fixed typo

Stephen Ficklin 6 years ago
parent
commit
d175cbb5a3
2 changed files with 6 additions and 2 deletions
  1. 4 0
      tripal/includes/tripal.entity.inc
  2. 2 2
      tripal/tripal.module

+ 4 - 0
tripal/includes/tripal.entity.inc

@@ -560,6 +560,10 @@ function tripal_ajax_attach_field($id) {
     reset($result);
     $entity = $result[$entity_id];
 
+    // Settings for whether to hide fields for this content type.
+    $bundle_info = tripal_load_bundle_entity(array('name' => $entity->bundle));
+    $hide_variable = tripal_get_bundle_variable('hide_empty_field', $bundle_info->id);
+
     // Get the element render array for this field and turn off the label
     // display. It's already on the page.  We need to get the display from the
     // instance and pass it into the field_view_field. Otherwise it uses the

+ 2 - 2
tripal/tripal.module

@@ -1527,8 +1527,8 @@ function tripal_field_display_TripalEntity_alter(&$display, $context){
   $hide_variable = tripal_get_bundle_variable('hide_empty_field', $bundle_info->id);
   $ajax_field = tripal_get_bundle_variable('ajax_field', $bundle_info->id);
   if($hide_variable == TRUE && $ajax_field == FALSE){
-    $item = field_get_items('TripalEntity', $context['entity'], $field_name);
-    if($item) {
+    $items = field_get_items('TripalEntity', $context['entity'], $field_name);
+    if($items) {
       $field = field_info_field($field_name);
       if(tripal_field_is_empty($field, $items)) {
         // Stop the right rail element from rendering.