Browse Source

Minor formatting issues, hook name correction, and GFF importer adjustment

Stephen Ficklin 6 years ago
parent
commit
baba8a48d1

+ 2 - 2
tripal_chado/api/tripal_chado.schema.api.inc

@@ -524,8 +524,8 @@ function chado_get_schema($table) {
   // An API call we can call directly.  The only time this occurs is
   // during an upgrade of a major Drupal version and tripal_core is disabled.
   if ((!$table_arr or !is_array($table_arr)) and
-        function_exists('tripal_core_' . $hook_name)) {
-    $api_hook = "tripal_core_" . $hook_name;
+        function_exists('tripal_chado_' . $hook_name)) {
+    $api_hook = "tripal_chado_" . $hook_name;
     $table_arr = $api_hook();
   }
 

+ 9 - 11
tripal_chado/includes/TripalFields/sbo__relationship/sbo__relationship_formatter.inc

@@ -122,23 +122,21 @@ class sbo__relationship_formatter extends ChadoFieldFormatter {
     $pager = $this->ajaxifyPager($pager, $entity);
     $page_items = array_chunk($rows, $items_per_page);
 
-    $content = '';
-    if ($total_pages > 1) {
-      if (count($rows) == 1) {
-        $content = 'There is ' . count($rows) . ' relationship.';
-      }
-      if (count($rows) > 1) {
-        $content = 'There are ' . count($rows) . ' relationships.';
-      }
+    $caption = '';
+    if ($total_records == 1) {
+      $caption = 'There is ' . count($rows) . ' relationship.';
+    }
+    else {
+      $caption = 'There are ' . count($rows) . ' relationships.';
     }
-    $content .= theme_table(array(
+    $content = theme_table(array(
       'header' => $headers,
       'rows' => count($rows) > 0 ? $page_items[$current_page] : array(),
       'attributes' => array(
-        'id' => 'sbo--relationship-table',
+        'class' => 'tripal-data-table',
       ),
       'sticky' => FALSE,
-      'caption' => '',
+      'caption' => $caption,
       'colgroups' => array(),
       'empty' => $settings['empty'],
     ));

+ 6 - 1
tripal_chado/includes/TripalImporter/GFF3Importer.inc

@@ -565,7 +565,12 @@ class GFF3Importer extends TripalImporter {
         $strand = -1;
       }
       if (strcmp($phase, '.') == 0) {
-        $phase = '';
+        if ($type == 'CDS') {
+          $phase = '0';
+        }
+        else {
+          $phase = '';
+        }
       }
       if (array_key_exists($type, $cvterm_lookup)) {
         $cvterm = $cvterm_lookup[$type];