Browse Source

Fixed bug with publication formatter

Stephen Ficklin 8 years ago
parent
commit
b4a7e1d51e

+ 0 - 1
tripal_chado/includes/TripalFields/schema__publication/schema__publication.inc

@@ -90,7 +90,6 @@ class schema__publication extends ChadoField {
       'return_array' => 1,
     );
     $record = chado_expand_var($record, 'table', $linker_table, $options);
-
     if (count($record->$linker_table) > 0) {
       $i = 0;
       foreach ($record->$linker_table as $index => $linker) {

+ 6 - 1
tripal_chado/includes/TripalFields/schema__publication/schema__publication_formatter.inc

@@ -41,7 +41,12 @@ class schema__publication_formatter extends ChadoFieldFormatter {
 
     krsort($list_items, SORT_NUMERIC);
 
-    $list = 'There are no publications.';
+    if (count($list_items) == 0) {
+      $list = 'There are no publications.';
+    }
+    if (count($list_items) == 1) {
+      $list = $list_items[0];
+    }
     if (count($list_items) > 1) {
       $list = array(
         'title' => '',