Browse Source

Bug fixes

spficklin 12 years ago
parent
commit
48f972cd1b

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

@@ -207,7 +207,7 @@ function tripal_core_chado_insert($table, $values, $options = array()) {
           $ukselect_vals[$field] = $insert_values[$field];
         }
         // now check the constraint
-        $coptions = array('statement_name' => 'uqsel_' . $table . '_' . implode('_',$ukselect_cols));
+        $coptions = array('statement_name' => 'uqsel_' . $table . '_' . $name);
         if (tripal_core_chado_select($table, $ukselect_cols, $ukselect_vals, $coptions)) {
           watchdog('tripal_core', "tripal_core_chado_insert: Cannot insert duplicate record into $table table: " . print_r($values, 1), array(), 'WATCHDOG_ERROR');
           return FALSE;

+ 2 - 2
tripal_feature/includes/gff_loader.inc

@@ -757,8 +757,8 @@ function tripal_feature_load_gff3_parents($feature, $cvterm, $parents, &$gff_fea
       );
       $options = array('statement_name' => 'sel_featurerelationship_objectid_subjectid_typeid');
       $rel = tripal_core_chado_select('feature_relationship', array('*'), $values, $options);
-      
-      if (count($rel > 0)) {
+
+      if (count($rel) > 0) {
         fwrite($log, "   Relationship already exists, skipping '$uname' ($type) $rel_type '$parent' ($parent_type)\n");
       }
       else {

+ 6 - 1
tripal_feature/tripal_feature.module

@@ -949,12 +949,17 @@ function chado_feature_validate($node) {
  *
  * @ingroup tripal_feature
  */
-function chado_feature_load($node) {
+function chado_feature_load($node) {  
+
   // get the feature details from chado
   $feature_id = chado_get_id_for_node('feature', $node);
 
   $values = array('feature_id' => $feature_id);
   $feature = tripal_core_generate_chado_var('feature', $values);
+  
+  if(strcmp($feature->name,$feature->uniquename)==0){
+     $node->title = $feature->name ." (" . $feature->type_id->name . ") " . $feature->organism_id->genus . " " . $feature->organism_id->species ;
+  }
 
   $additions = new stdClass();
   $additions->feature = $feature;