Explorar o código

Merge pull request #1039 from tripal/1038-tv3-pre_release_fixes

Fixes for issue #1038
Stephen Ficklin %!s(int64=5) %!d(string=hai) anos
pai
achega
8be02bbf8c

+ 1 - 0
tripal/includes/TripalEntityCollection.inc

@@ -527,6 +527,7 @@ class TripalEntityCollection {
     }
     if ($job) {
       $job->setTotalItems($total_entities);
+      $job->setInterval(1);
     }
 
     // Iterate through the bundles in this collection and get the entities.

+ 1 - 1
tripal/includes/TripalJob.inc

@@ -28,7 +28,7 @@ class TripalJob {
 
   /**
    * The interval when the job progress should be updated. Updating the job
-   * progress incurrs a database write which takes time and if it occurs to
+   * progress incurrs a database write which takes time and if it occurs too
    * frequently can slow down the loader.  This should be a value between
    * 0 and 100 to indicate a percent interval (e.g. 1 means update the
    * progress every time the num_handled increases by 1%).

+ 2 - 0
tripal_chado/includes/TripalFields/sio__references/sio__references.inc

@@ -98,6 +98,7 @@ class sio__references extends ChadoField {
       $matches = [];
       if (preg_match('/^(.+?)_pub$/', $chado_table, $matches)) {
         $reference_table = $matches[1];
+
         // Find the base table this links to and get the fk columns that map it.
         $schema = chado_get_schema($chado_table);
         $fkeys = $schema['foreign keys'];
@@ -106,6 +107,7 @@ class sio__references extends ChadoField {
             $fkleft = array_keys($fk_details['columns'])[0];
             $fkright = $fk_details['columns'][$fkleft];
           }
+
         }
         // Iterate through all of the records in the linker table that
         // match the given pub ID.

+ 5 - 0
tripal_chado/includes/TripalFields/sio__references/sio__references_formatter.inc

@@ -16,6 +16,11 @@ class sio__references_formatter extends ChadoFieldFormatter {
     $field_name = $this->field['field_name'];
     $chado_table = $this->instance['settings']['chado_table'];
 
+    // Do we have an empty list? If so, just return.
+    if (!$items[0]['value']) {
+      return;
+    }
+
     // First, organize the values by their types.
     $ordered_items = [];
     foreach ($items as $delta => $item) {