Browse Source

Reworked again

Stephen Ficklin 5 years ago
parent
commit
2a6030eba5

+ 2 - 4
tripal_chado/api/tripal_chado.query.api.inc

@@ -1741,8 +1741,7 @@ function chado_query($sql, $args = []) {
       $matches = $matches[1];
       $chado_tables = array_unique(array_keys(chado_get_table_names(TRUE)));
       foreach ($matches as $match) {
-        $match = strtolower($match);
-        if (in_array($match, $chado_tables)) {
+        if (in_array(strtolower($match), $chado_tables)) {
           $sql = preg_replace("/\{$match\}/", $chado_schema_name . '.' . $match, $sql);
         }
       }
@@ -1753,8 +1752,7 @@ function chado_query($sql, $args = []) {
       $matches = $matches[1];
       $drupal_tables = array_unique(array_keys(drupal_get_schema()));
       foreach ($matches as $match) {
-        $match = strtolower($match);
-        if (in_array($match, $drupal_tables)) {
+        if (in_array(strtolower($match), $drupal_tables)) {
           $sql = preg_replace("/\[$match\]/", $drupal_schema_name . '.' . $match, $sql);
         }
       }

+ 1 - 1
tripal_chado/includes/ChadoPrefixExtender.inc

@@ -189,7 +189,7 @@ class ChadoPrefixExtender extends SelectQueryExtender {
       static::$chado_tables = chado_get_table_names(TRUE);
     }
 
-    return in_array($table, static::$chado_tables);
+    return in_array(strtolower($table), static::$chado_tables);
   }
 
   /**