浏览代码

Merge pull request #495 from tripal/fix-tv3-rc3_pre_release

Fix tv3 rc3 pre release
Stephen Ficklin 6 年之前
父节点
当前提交
319a6d3ee9

+ 11 - 12
tripal/api/tripal.terms.api.inc

@@ -411,17 +411,16 @@ function tripal_get_term_details($vocabulary, $accession) {
       }
       // Let the user know that the url is missing.
       if ($url_missing) {
-        
-        tripal_add_notification(
-          "Missing CV term URL", 
-          t("The controlled vocabulary, %vocab, is missing a URL. Tripal will handle " .
-            "this by linking to the cv/lookup page of this site. However, the correct " .
-            "should be updated for this site", 
-            ['%vocab' => $term['vocabulary']['short_name']]),
-          'Controlled Vocabularies', 
-          NULL, 
-          'mising-vocab-' . $term['vocabulary']['short_name']
-        );
+//         tripal_add_notification(
+//           "Missing CV term URL", 
+//           t("The controlled vocabulary, %vocab, is missing a URL. Tripal will handle " .
+//             "this by linking to the cv/lookup page of this site. However, the correct " .
+//             "should be updated for this site", 
+//             ['%vocab' => $term['vocabulary']['short_name']]),
+//           'Controlled Vocabularies', 
+//           NULL, 
+//           'mising-vocab-' . $term['vocabulary']['short_name']
+//         );
       }
       
       return $term;
@@ -627,7 +626,7 @@ function tripal_get_term_lookup_form(&$form, &$form_state, $default_name = '',
   }
 
   $term_name = $default_name;
-  if (array_key_exists('values', $form_state)) {
+  if (array_key_exists('values', $form_state) and array_key_exists('term_name', $form_state['values'])) {
     $term_name = $form_state['values']['term_name'];
   }
   if ($field_name and array_key_exists('input', $form_state) and array_key_exists($field_name, $form_state['input'])) {

+ 2 - 0
tripal_chado/includes/TripalFields/schema__additional_type/schema__additional_type_widget.inc

@@ -44,6 +44,7 @@ class schema__additional_type_widget extends ChadoFieldWidget {
     // If a parent_term is provided then use that to get the options
     $options = array();
     $options[] = 'Select a type';
+    $vocabulary = '';
     if ($enforce_parent_term) {
       list ($vocabulary, $accession) = explode(':', $enforce_parent_term);
       if ($vocabulary and $accession) {
@@ -70,6 +71,7 @@ class schema__additional_type_widget extends ChadoFieldWidget {
       }
     }
     elseif ($enforce_vocabulary) {
+      $vocabulary = $enforce_vocabulary;
       $cv = chado_get_cv(array('name' => $enforce_vocabulary));
       $options = chado_get_cvterm_select_options($cv->cv_id);
     }

+ 1 - 1
tripal_chado/includes/TripalFields/taxrank__infraspecific_taxon/taxrank__infraspecific_taxon_widget.inc

@@ -102,7 +102,7 @@ class taxrank__infraspecific_taxon_widget extends ChadoFieldWidget {
       $form_state['values'][$field_name]['und'][0]['chado-organism__type_id'] = $type_id;
       $form_state['values'][$field_name]['und'][0]['chado-organism__infraspecific_name'] = $infra_name;
     }
-    if ($infra_name and !$type_id) {
+    else if ($infra_name and !$type_id) {
       $form_state['values'][$field_name]['und'][0]['value'] = $infra_name;
       $form_state['values'][$field_name]['und'][0]['chado-organism__type_id'] = '__NULL__';
       $form_state['values'][$field_name]['und'][0]['chado-organism__infraspecific_name'] = $infra_name;

+ 2 - 1
tripal_chado/includes/setup/tripal_chado.setup.inc

@@ -100,7 +100,7 @@ function tripal_chado_load_ontologies() {
       'path' => '{tripal_chado}/files/tcontact.obo',
       'auto_load' => TRUE,
       'cv_name' => 'tripal_contact',
-      'db_name' => 'TCONTACT'
+      'db_name' => 'TContact'
     ),
     array(
       'name' => 'Tripal Publication',
@@ -131,6 +131,7 @@ function tripal_chado_load_ontologies() {
         $obo_importer = new OBOImporter();
         $obo_importer->create(array('obo_id' => $obo_id));
         $obo_importer->run();
+        $obo_importer->postRun();
       }
       else {
         print "Ontology already loaded (skipping): " . $ontologies[$i]['name'] . "...\n";

+ 1 - 1
tripal_chado/includes/tripal_chado.entity.inc

@@ -152,7 +152,7 @@ function tripal_chado_tripal_default_title_format($bundle, $available_tokens) {
     }
     else {
       $format[] = array(
-        'format' => '[taxrank__genus] [taxrank__species] [taxrank__infraspecific_taxon]',
+        'format' => '[taxrank__genus] [taxrank__species] [taxrank__infraspecific_taxon,TAXRANK:0000045]',
         'weight' => -5
       );
     }

+ 9 - 7
tripal_chado/includes/tripal_chado.fields.inc

@@ -223,8 +223,10 @@ function tripal_chado_bundle_fields_info_custom(&$info, $details, $entity_type,
 
   $schema = chado_get_schema($table_name);
 
-  // Handle type_id fields that are not the type_column.
-  if (array_key_exists('type_id', $schema['fields']) and 'type_id' != $type_column) {
+  // Handle type_id fields that are not the type_column, except for the
+  // organism type_id as that is handled by the taxrank__infraspecific_taxon
+  // field.
+  if (array_key_exists('type_id', $schema['fields']) and 'type_id' != $type_column and $table_name != 'organism') {
     $field_name = 'schema__additional_type';
     $field_type = 'schema__additional_type';
     $info[$field_name] = array(
@@ -547,7 +549,7 @@ function tripal_chado_bundle_fields_info_custom(&$info, $details, $entity_type,
   
   // For the pub_id field in the base table.
   $schema = chado_get_schema($table_name);
-  if (array_key_exists('pub_id', $schema['fields'])) {
+  if (array_key_exists('pub_id', $schema['fields']) and $table_name != 'pub') {
     
     // Remove the schema__publication added by the
     // tripal_chado_bunde_instnaces_info_base function.
@@ -567,7 +569,7 @@ function tripal_chado_bundle_fields_info_custom(&$info, $details, $entity_type,
   } 
 
   // Analysis Id
-  if (array_key_exists('analysis_id', $schema['fields'])) {
+  if (array_key_exists('analysis_id', $schema['fields']) and $table_name != 'analysis') {
     $field_name = 'operation__analysis';
     $field_type = 'operation__analysis';
     $info[$field_name] = array(
@@ -1293,7 +1295,7 @@ function tripal_chado_bundle_instances_info_custom(&$info, $entity_type, $bundle
   $schema = chado_get_schema($table_name);
 
   // An additional type for publications
-  if (array_key_exists('type_id', $schema['fields']) and 'type_id' != $type_column) {
+  if (array_key_exists('type_id', $schema['fields']) and 'type_id' != $type_column and $table_name != 'organism') {
     $field_name = 'schema__additional_type';
     $is_required = FALSE;
     if (array_key_exists('not null', $schema['fields']['type_id']) and
@@ -2053,7 +2055,7 @@ function tripal_chado_bundle_instances_info_custom(&$info, $entity_type, $bundle
   } 
   // pub_id field in table.
   $schema = chado_get_schema($table_name);
-  if (array_key_exists('pub_id', $schema['fields'])) {
+  if (array_key_exists('pub_id', $schema['fields']) and $table_name != 'pub') {
     
     // Remove the schema__publication added by the 
     // tripal_chado_bunde_instnaces_info_base function.
@@ -2164,7 +2166,7 @@ function tripal_chado_bundle_instances_info_custom(&$info, $entity_type, $bundle
     );
   } 
   // Analysis Id
-  if (array_key_exists('analysis_id', $schema['fields'])) {
+  if (array_key_exists('analysis_id', $schema['fields']) and $table_name != 'analysis') {
     $field_name = 'operation__analysis';
     $is_required = FALSE;
     if (array_key_exists('not null', $schema['fields']['analysis_id']) and