Browse Source

Fix for logging errors

Stephen Ficklin 6 years ago
parent
commit
c6b8bf407b
1 changed files with 5 additions and 1 deletions
  1. 5 1
      tripal_chado/api/tripal_chado.custom_tables.api.inc

+ 5 - 1
tripal_chado/api/tripal_chado.custom_tables.api.inc

@@ -354,14 +354,18 @@ function chado_get_custom_table_id($table_name) {
  */
 function chado_get_base_custom_tables() {
 
+  $num_tables = 0;
   $sql = "SELECT table_name FROM {tripal_custom_tables} WHERE is_base = 1";
   $resource = db_query($sql);
 
   foreach ($resource as $r) {
     $tables[$r->table_name] = $r->table_name;
+    $num_tables++;
   }
 
-  asort($tables);
+  if ($num_tables > 0) {
+    asort($tables);
+  }
   return $tables;
 }