Преглед на файлове

Changed chado_select query to return empty array if sub-query failed or is empty

Chun-Huai Cheng преди 9 години
родител
ревизия
beae1c1e9b
променени са 1 файла, в които са добавени 2 реда и са изтрити 0 реда
  1. 2 0
      tripal_core/api/tripal_core.chado_query.api.inc

+ 2 - 0
tripal_core/api/tripal_core.chado_query.api.inc

@@ -1233,6 +1233,7 @@ function chado_select_record($table, $columns, $values, $options = NULL) {
               for %field where the definition supplied was %value',
               array('%field' => $field, '%value' => print_r($value, TRUE))
             );
+            return array();
           }
           // Ensure that there were results returned.
           elseif (count($results)==0) {
@@ -1241,6 +1242,7 @@ function chado_select_record($table, $columns, $values, $options = NULL) {
               returned no results where the definition supplied was %value',
               array('%field' => $field, '%value' => print_r($value, TRUE))
             );
+            return array();
           }
           // If there was only a single resutlt then add it using an op of =.
           elseif (count($results) == 1) {