Explorar o código

Fixed issue #1939938. Unique ID should now always be unique even if two features have the same name

Ficklin %!s(int64=10) %!d(string=hai) anos
pai
achega
64b9e7e33c
Modificáronse 1 ficheiros con 5 adicións e 3 borrados
  1. 5 3
      tripal_feature/includes/tripal_feature.gff_loader.inc

+ 5 - 3
tripal_feature/includes/tripal_feature.gff_loader.inc

@@ -699,14 +699,16 @@ function tripal_feature_load_gff3($gff_file, $organism_id, $analysis_id,
       }
 
       // if a name is not specified then use the unique name as the name
-      if (strcmp($attr_name, '')==0) {
+      if (strcmp($attr_name, '') == 0) {
         $attr_name = $attr_uniquename;
       }
 
-      // if an ID attribute is not specified then use the attribute name plus the date
+      // if an ID attribute is not specified then we must generate a
+      // unique ID. Do this by combining the attribute name with the date
+      // and line number.
       if (!$attr_uniquename) {
         $date = getdate();
-        $attr_uniquename = $attr_name . '-' . $date[0];
+        $attr_uniquename = $attr_name . '-' . $date[0] . '-' . $line_num;
       }
 
       // make sure the landmark sequence exists in the database.  If the user