Browse Source

Merge branch '7.x-3.x' of github.com:tripal/tripal into 7.x-3.x

Stephen Ficklin 8 years ago
parent
commit
85a9780776

+ 1 - 1
docs/tripal_doxygen.config

@@ -31,7 +31,7 @@ PROJECT_NAME           = Tripal
 # This could be handy for archiving the generated documentation or
 # if some version control system is used.
 
-PROJECT_NUMBER         = "v1.1 (6.x-1.1)"
+PROJECT_NUMBER         = "v3.0 (7.x-3.0)"
 
 # Using the PROJECT_BRIEF tag one can provide an optional one line description
 # for a project that appears at the top of each page and should give viewer

+ 1 - 1
legacy/tripal_analysis/includes/tripal_analysis.chado_node.inc

@@ -215,7 +215,7 @@ function chado_analysis_form($node, &$form_state) {
   $day = preg_replace("/^\d+-\d+-0?(\d+) .*/", "$1", $default_time);
   // If the time is not set, use current time
   if (!$default_time) {
-    $default_time = time();
+    $default_time = REQUEST_TIME;
     $year  = format_date($default_time, 'custom', 'Y');
     $month = format_date($default_time, 'custom', 'n');
     $day   = format_date($default_time, 'custom', 'j');

+ 1 - 1
legacy/tripal_feature/tripal_feature.install

@@ -136,7 +136,7 @@ function tripal_feature_uninstall() {
       ),
       'phase' => array(
         'type' => 'int',
-        'not null' => TRUE,
+        'not null' => FALSE,
       ),
       'strand' => array(
         'type' => 'int',

+ 12 - 2
legacy/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'
@@ -262,7 +272,7 @@ function chado_pub_form($node, $form_state) {
   $cv_id = $prop_cv ? $prop_cv->cv_id : NULL;
   // 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

+ 1 - 1
tripal/api/tripal.jobs.api.inc

@@ -217,7 +217,7 @@ function tripal_max_jobs_exceeded($max_jobs) {
       // the job is not running so terminate it
       $record = new stdClass();
       $record->job_id = $job->job_id;
-      $record->end_time = REQUEST_TIME;
+      $record->end_time = time();
       $record->status = 'Error';
       $record->error_msg = 'Job has terminated unexpectedly.';
       drupal_write_record('tripal_jobs', $record, 'job_id');

+ 2 - 2
tripal_chado/api/modules/tripal_chado.analysis.api.inc

@@ -174,7 +174,7 @@ function tripal_get_analysis_select_options($syncd_only = TRUE) {
   if ($syncd_only) {
     $sql = "
       SELECT *
-      FROM public.chado_analysis CA
+      FROM [chado_analysis] CA
         INNER JOIN {analysis} A ON A.analysis_id = CO.analysis_id
       ORDER BY A.name
     ";
@@ -196,4 +196,4 @@ function tripal_get_analysis_select_options($syncd_only = TRUE) {
     }
   }
   return $analysis_list;
-}
+}

+ 2 - 6
tripal_chado/api/tripal_chado.query.api.inc

@@ -969,7 +969,7 @@ function chado_delete_record($table, $match, $options = NULL) {
   $fields = $table_desc['fields'];
   if (empty($table_desc)) {
     tripal_report_error('tripal_chado', TRIPAL_WARNING,
-      'chado_insert_record; There is no table description for !table_name',
+      'chado_delete_record; There is no table description for !table_name',
       array('!table_name' => $table), array('print' => $print_errors)
     );
   }
@@ -1229,8 +1229,6 @@ function chado_select_record($table, $columns, $values, $options = NULL) {
     return FALSE;
   }
 
-  $select = '';
-  $from = '';
   $where = array();
   $args = array();
 
@@ -1328,8 +1326,6 @@ function chado_select_record($table, $columns, $values, $options = NULL) {
       return array();
     }
 
-    $select[] = $field;
-
     // CASE 1: We have an array for a value.
     if (is_array($value)) {
 
@@ -1907,4 +1903,4 @@ function chado_db_select($table, $alias = NULL, array $options = array()) {
   $conninfo = Database::getConnectionInfo();
   $conn = new ChadoDatabaseConnection($conninfo['default']);
   return $conn->select($table, $alias, $options);
-}
+}

+ 1 - 1
tripal_chado/includes/TripalImporter/GFF3Importer.inc

@@ -2180,4 +2180,4 @@ class GFF3Importer extends TripalImporter {
           array('%target' => $tags['Target'][0]), TRIPAL_ERROR);
     }
   }
-}
+}

+ 11 - 0
tripal_chado/includes/loaders/tripal_chado.pub_importers.inc

@@ -14,6 +14,17 @@ require_once('tripal_chado.pub_importer_PMID.inc');
  * @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']);