Browse Source

Fixed bug in argument for formatter view hooks

Stephen Ficklin 8 years ago
parent
commit
11cfd547ff

+ 6 - 2
tripal/includes/tripal.entity.inc

@@ -326,8 +326,12 @@ function tripal_ajax_attach_field($id) {
     $entity = $result[$entity_id];
 
     // Get the element render array for this field and turn off the label
-    // display. It's already on the page.
-    $element = field_view_field('TripalEntity', $entity, $field_name);
+    // 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
+    // instance default display settings. Not sure why it does this. It needs
+    // more investigation.
+    $instance = field_info_instance('TripalEntity', $field_name, $entity->bundle);
+    $element = field_view_field('TripalEntity', $entity, $field_name, $instance['display']['default']);
     $element['#label_display'] = 'hidden';
 
     $content = drupal_render($element);

+ 1 - 2
tripal_chado/includes/TripalFields/sbo__relationship/sbo__relationship_formatter.inc

@@ -52,8 +52,7 @@ class sbo__relationship_formatter extends ChadoFieldFormatter {
    */
   public function view(&$element, $entity_type, $entity, $langcode, $items, $display) {
     // Get the settings
-    //$settings = $display['settings'];
-    $settings = $this->instance['display']['default']['settings'];
+    $settings = $display['settings'];
 
     $rows = array();
     $headers = array($settings['title']);