Browse Source

Fixed bug with disappearing fields

Stephen Ficklin 9 years ago
parent
commit
444460a766
2 changed files with 3 additions and 6 deletions
  1. 2 2
      tripal_chado/includes/tripal_chado.fields.inc
  2. 1 4
      tripal_chado/tripal_chado.module

+ 2 - 2
tripal_chado/includes/tripal_chado.fields.inc

@@ -359,9 +359,9 @@ function tripal_chado_field_formatter_view($entity_type, $entity, $field,
 
   $element = array();
 
-  $field_type = $display['type'];
+  $field_type = $field['type'];
   module_load_include('inc', 'tripal_chado', 'includes/fields/' . $field_type);
-  $function = $field_type;
+  $function = $display['type'];
   if (function_exists($function)) {
     $function($element, $entity_type, $entity, $field, $instance, $langcode, $items, $display);
   }

+ 1 - 4
tripal_chado/tripal_chado.module

@@ -603,11 +603,9 @@ function tripal_chado_theme($existing, $type, $theme, $path) {
 
 /**
  * Implements hook_entity_view().
- *
- * This function is used to support legacy Tripal v2 templates
- * for use with Tripal v3 entities.
  */
 function tripal_chado_entity_view($entity, $type, $view_mode, $langcode) {
+
   // If this entity is a TripalEntity and is a full view, then
   // we want to support the legacy view, but only if the legacy
   // module is enabled (the functions exist).
@@ -630,7 +628,6 @@ function tripal_chado_entity_view($entity, $type, $view_mode, $langcode) {
       // a legacy tmplate then prepare the entity and content to fake a
       // node.
       if (key_exists($legacy_template, $enabled_templates) && $enabled_templates[$legacy_template]) {
-
         // Remove the fields added by the chado_field_storage.
         $fields = field_info_fields();
         foreach($fields as $field) {