Browse Source

Fix for issue #971

Stephen Ficklin 5 years ago
parent
commit
a1108f137e
1 changed files with 2 additions and 2 deletions
  1. 2 2
      tripal_chado/api/tripal_chado.query.api.inc

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

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