Stephen Ficklin 8 jaren geleden
bovenliggende
commit
eb19a57b02

+ 1 - 1
tripal_core/includes/tripal_core.jobs.inc

@@ -290,7 +290,7 @@ function tripal_jobs_view($job_id) {
   $links .= l('Re-run this job', "admin/tripal/tripal_jobs/rerun/" . $job->job_id) . ' | ';
   if ($job->start_time == 0 and $job->end_time == 0) {
     $links .= l('Cancel this job', "admin/tripal/tripal_jobs/cancel/" . $job->job_id) . ' | ';
-    $links .= l('Execute this job', "admin/tripal/tripal_jobs/execute/".$job->job_id);
+    $links .= l('Execute this job', "admin/tripal/tripal_jobs/execute/" . $job->job_id);
   }
 
   // make our start and end times more legible

+ 1 - 1
tripal_feature/includes/tripal_feature.chado_node.inc

@@ -233,7 +233,7 @@ function chado_feature_form($node, &$form_state) {
 
   // RELATIONSHIPS FORM
   //---------------------------------------------
-  $relationship_cv = tripal_get_default_cv('feature_relationship', 'type_id');
+  $relationship_cv = tripal_get_default_cv('sequence', 'type_id');
   $cv_id = $relationship_cv ? $relationship_cv->cv_id : NULL;
   $details = array(
     'relationship_table' => 'feature_relationship',

+ 22 - 3
tripal_feature/tripal_feature.install

@@ -68,7 +68,7 @@ function tripal_feature_install() {
   // Set the default vocabularies.
   tripal_set_default_cv('feature', 'type_id', 'sequence');
   tripal_set_default_cv('featureprop', 'type_id', 'feature_property');
-  tripal_set_default_cv('feature_relationship', 'type_id', 'feature_relationship');
+  tripal_set_default_cv('feature_relationship', 'type_id', 'sequence');
 }
 
 /**
@@ -405,7 +405,7 @@ function tripal_feature_update_7200() {
     );
     tripal_set_default_cv('feature', 'type_id', 'sequence');
     tripal_set_default_cv('featureprop', 'type_id', 'feature_property');
-    tripal_set_default_cv('feature_relationship', 'type_id', 'feature_relationship');
+    tripal_set_default_cv('feature_relationship', 'type_id', 'sequence');
   }
 
   catch (\PDOException $e) {
@@ -515,4 +515,23 @@ function tripal_feature_update_7203() {
     $error = $e->getMessage();
     throw new DrupalUpdateException('Failed to complete update' . $error);
   }
-}
+}
+
+/**
+ * Changes the default vocabulary for the feature_relationship table to 'sequence'.
+ */
+function tripal_feature_update_7204() {
+  // Make sure we have the full API loaded this will help during a
+  // site upgrade when the tripal_core module is disabled.
+  module_load_include('module', 'tripal_core', 'tripal_core');
+  tripal_core_import_api();
+
+  try {
+    tripal_set_default_cv('feature_relationship', 'type_id', 'sequence');
+  }
+  catch (\PDOException $e) {
+    $error = $e->getMessage();
+    throw new DrupalUpdateException('Failed to complete update' . $error);
+  }
+}
+

+ 19 - 9
tripal_pub/includes/tripal_pub.chado_node.inc

@@ -46,6 +46,16 @@ function tripal_pub_node_info() {
 function chado_pub_form($node, $form_state) {
   $form = array();
 
+  // Check to make sure that the tripal_pub vocabulary is loaded. If not, then
+  // warn the user that they should load it before continuing.
+  $pub_cv = chado_select_record('cv', array('cv_id'), array('name' => 'tripal_pub'));
+  if (count($pub_cv) == 0) {
+    drupal_set_message(t('The Tripal Pub vocabulary is currently not loaded. ' .
+        'This vocabulary is required to be loaded before adding ' .
+        'publications.  <br>Please !import',
+        array('!import' => l('load the Tripal Publication vocabulary', 'admin/tripal/loaders/obo_loader'))), 'warning');
+  }
+
   // Default values can come in the following ways:
   //
   // 1) as elements of the $node object.  This occurs when editing an existing pub
@@ -190,7 +200,7 @@ function chado_pub_form($node, $form_state) {
   );
 
   $type_cv = tripal_get_default_cv('pub', 'type_id');
-  if ($type_cv->name == 'tripal_pub') {
+  if ($type_cv and $type_cv->name == 'tripal_pub') {
 
     // get the list of publication types.  In the Tripal publication
     // ontologies these are all grouped under the term 'Publication Type'
@@ -241,13 +251,13 @@ function chado_pub_form($node, $form_state) {
     '#type' => 'textarea',
     '#title' => t('Citation'),
     '#default_value' => $uniquename,
-    '#description' => t('All publications must have a unique citation.
-      <b>Please enter the full citation for this publication or leave blank and one will be generated
-      automatically if possible</b>.  For PubMed style citations list
-      the last name of the author followed by initials. Each author should be separated by a comma. Next comes
-      the title, followed by the series title (e.g. journal name), publication date (4 digit year, 3 character Month, day), volume, issue and page numbers. You may also use HTML to provide a link in the citation.
-      Below is an example: <pre>Medeiros PM, Ladio AH, Santos AM, Albuquerque UP. <a href="http://www.ncbi.nlm.nih.gov/pubmed/23462414" target="_blank">Does the selection of medicinal plants by Brazilian local populations
-        suffer taxonomic influence?</a> J Ethnopharmacol. 2013 Apr 19; 146(3):842-52.</pre>'),
+    '#description' => t('All publications must have a unique citation. ' .
+      '<b>Please enter the full citation for this publication or leave blank and one will be generated ' .
+      'automatically if possible</b>.  For PubMed style citations list ' .
+      'the last name of the author followed by initials. Each author should be separated by a comma. Next comes ' .
+      'the title, followed by the series title (e.g. journal name), publication date (4 digit year, 3 character Month, day), volume, issue and page numbers. You may also use HTML to provide a link in the citation. ' .
+      'Below is an example: <pre>Medeiros PM, Ladio AH, Santos AM, Albuquerque UP. <a href="http://www.ncbi.nlm.nih.gov/pubmed/23462414" target="_blank">Does the selection of medicinal plants by Brazilian local populations ' .
+      'suffer taxonomic influence?</a> J Ethnopharmacol. 2013 Apr 19; 146(3):842-52.</pre>'),
   );
   $form['is_obsolete'] = array(
     '#type' => 'checkbox',
@@ -263,7 +273,7 @@ function chado_pub_form($node, $form_state) {
 
   // if the poperty cv is 'tripal_pub' then we need to pass in our own select_options
   // for only a subset of the vocabulary
-  if ($prop_cv->name == 'tripal_pub') {
+  if ($prop_cv and $prop_cv->name == 'tripal_pub') {
     $select_options[] = 'Select a Property';
     $sql = "
       SELECT

+ 11 - 0
tripal_pub/includes/tripal_pub.pub_importers.inc

@@ -10,6 +10,17 @@
  * @ingroup tripal_pub
  */
 function tripal_pub_importers_list() {
+
+  // Check to make sure that the tripal_pub vocabulary is loaded. If not, then
+  // warn the user that they should load it before continuing.
+  $pub_cv = chado_select_record('cv', array('cv_id'), array('name' => 'tripal_pub'));
+  if (count($pub_cv) == 0) {
+    drupal_set_message(t('The Tripal Pub vocabulary is currently not loaded. ' .
+        'This vocabulary is required to be loaded before importing of ' .
+        'publications.  <br>Please !import',
+        array('!import' => l('load the Tripal Publication vocabulary', 'admin/tripal/loaders/obo_loader'))), 'warning');
+  }
+
   // clear out the session variable when we view the list.
   unset($_SESSION['tripal_pub_import']);