瀏覽代碼

Merge branch '6.x-6233304-Support_for_Chado_v1.2' of git.drupal.org:sandbox/spficklin/1337878 into 6.x-6233304-Support_for_Chado_v1.2

spficklin 12 年之前
父節點
當前提交
88cd7860b3
共有 1 個文件被更改,包括 1 次插入7 次删除
  1. 1 7
      tripal_core/api/tripal_core.api.inc

+ 1 - 7
tripal_core/api/tripal_core.api.inc

@@ -696,7 +696,7 @@ function tripal_core_chado_select($table, $columns, $values, $options = NULL) {
           'case_insensitive_columns' => $options['case_insensitive_columns']
         );
         $results = tripal_core_chado_get_foreign_key($table_desc, $field, $value, $foreign_options);
-        if (count($results) ==0) {
+        if (!$results or count($results) ==0) {
 
           // foreign key records are required
           // thus if none matched then return FALSE and alert the admin through watchdog
@@ -777,12 +777,6 @@ function tripal_core_chado_select($table, $columns, $values, $options = NULL) {
     return array('sql' => $sql, 'args' => $args);
   }
   $previous_db = tripal_db_set_active('chado');  // use chado database
-  // if we got to this point and we have no arguments for our where
-  // clause then a recursive call to a FK relationship has returned nothing
-  // we can't continue so just return nothing.
-  if($where and empty($args)){
-     return array();
-  }
   $resource = db_query($sql, $args);
   tripal_db_set_active($previous_db);  // now use drupal database
   $results = array();