ソースを参照

minor tweaking

Stephen Ficklin 6 年 前
コミット
3fda98094e
1 ファイル変更3 行追加2 行削除
  1. 3 2
      tripal/includes/TripalEntityController.inc

+ 3 - 2
tripal/includes/TripalEntityController.inc

@@ -636,6 +636,7 @@ class TripalEntityController extends EntityAPIController {
         $info = entity_get_info($queried_entities[$id]->type);
         $field_cache = array_key_exists('field cache', $info) ? $info['field cache'] : FALSE;
         $bundle_name = $queried_entities[$id]->bundle;
+        $bundle = tripal_load_bundle_entity(array('name' => $bundle_name));
 
         // Iterate through the field instances and find those that are set to
         // 'auto_attach' and which are attached to this bundle. Add all
@@ -687,8 +688,8 @@ class TripalEntityController extends EntityAPIController {
           // attach then we will ignore it. It can only be set by providing
           // the id in the $field_id array handled previously.
           else {
-            // We only load via AJAX if empty fields are not hidden.
-            $bundle = tripal_load_bundle_entity(array('name' => $bundle_name));
+            // We only load via AJAX if instructed to do so and only for fields
+            // that are not auto attached.
             $ajax_field = tripal_get_bundle_variable('ajax_field', $bundle->id);
             if (array_key_exists('settings', $instance) and
                 array_key_exists('auto_attach', $instance['settings']) and