Explorar o código

Merge branch '7.x-3.x' into fix-tv3-rc3_pre_release

Stephen Ficklin %!s(int64=6) %!d(string=hai) anos
pai
achega
3e49cbd827

+ 7 - 1
tripal/api/tripal.terms.api.inc

@@ -391,6 +391,12 @@ function tripal_get_term_details($vocabulary, $accession) {
     $function = $module . '_vocab_get_term';
     if (function_exists($function)) {
       $term = $function($vocabulary, $accession);
+      
+      // If the vocabulary is missing then we have a problem.
+      if (!array_key_exists('vocabulary', $term)) {
+        tripal_report_error('tripal_term', TRIPAL_ERROR, "The term is missing a vocabulary entry.");
+        return FALSE;
+      }
 
       // Make sure the term has a URL. If it does not, then use the Tripal
       // interface as the URL for the term.
@@ -403,7 +409,7 @@ function tripal_get_term_details($vocabulary, $accession) {
         $url_missing = TRUE;
         $term['vocabulary']['sw_url'] = url('cv/lookup/' . $term['vocabulary']['short_name'] . '/' . $term['accession'], ['absolute' => TRUE]);
       }
-      // Let the user know that the vocabulary is missing.
+      // Let the user know that the url is missing.
       if ($url_missing) {
 //         tripal_add_notification(
 //           "Missing CV term URL", 

+ 5 - 5
tripal_chado/includes/setup/tripal_chado.setup.inc

@@ -194,11 +194,6 @@ function tripal_chado_prepare_chado($job = NULL) {
     drush_print("Loading Ontologies...");
     tripal_chado_load_ontologies();
 
-    // Populate the mviews based on controlled vocabularies.
-    drush_print('Populating materialized view db2cv_mview...');
-    $mview_id = chado_get_mview_id('db2cv_mview');
-    chado_populate_mview($mview_id);
-
     drush_print('Populating materialized view cv_root_mview...');
     $mview_id = chado_get_mview_id('cv_root_mview');
     chado_populate_mview($mview_id);
@@ -225,6 +220,11 @@ function tripal_chado_prepare_chado($job = NULL) {
       $job->setProgress(70);
     }
 
+    // Populate the mviews based on controlled vocabularies.
+    drush_print('Populating materialized view db2cv_mview...');
+    $mview_id = chado_get_mview_id('db2cv_mview');
+    chado_populate_mview($mview_id);
+    
     drush_print("Creating common Tripal Content Types...");
     drush_print("This may take awhile if you are upgrading a site that has lots of data...");
 

+ 1 - 0
tripal_chado/includes/tripal_chado.vocab_storage.inc

@@ -102,6 +102,7 @@ function tripal_chado_vocab_get_vocabulary($vocabulary) {
   $result = chado_query($sql, array(':name' => $vocabulary));
   $result = $result->fetchAssoc();
   if (!$result) {
+    drupal_set_message("Could not find details about the vocabulary: $vocabulary");
     return FALSE;
   }