Browse Source

Merge branch '7.x-2.x' of git.drupal.org:sandbox/spficklin/1337878 into 7.x-2.x

Lacey Sanderson 11 năm trước cách đây
mục cha
commit
39a6939097

+ 4 - 5
tripal_analysis/includes/tripal_analysis.chado_node.inc

@@ -16,12 +16,11 @@
 function tripal_analysis_node_info() {
   $nodes = array();
   $nodes['chado_analysis'] = array(
-    'name' => t('Analysis'),
-    'base' => 'chado_analysis',
+    'name'        => t('Analysis'),
+    'base'        => 'chado_analysis',
     'description' => t('An analysis'),
-    'has_title' => FALSE,
-    'title_label' => t('Analysis'),
-    'locked' => TRUE,
+    'has_title'   => TRUE,
+    'locked'      => TRUE,
     'chado_node_api' => array(
       'base_table' => 'analysis',
       'hook_prefix' => 'chado_analysis',

+ 4 - 5
tripal_bulk_loader/includes/tripal_bulk_loader.chado_node.inc

@@ -15,12 +15,11 @@
 function tripal_bulk_loader_node_info() {
   $nodes = array();
   $nodes['tripal_bulk_loader'] = array(
-      'name' => t('Bulk Loading Job'),
-      'base' => 'tripal_bulk_loader',
+      'name'        => t('Bulk Loading Job'),
+      'base'        => 'tripal_bulk_loader',
       'description' => t('A bulk loader for inserting tab-delimited data into chado database'),
-      'has_title' => TRUE,
-      'has_body' => FALSE,
-      'locked' => TRUE
+      'has_title'   => TRUE,
+      'locked'      => TRUE
   );
   return $nodes;
 }

+ 4 - 6
tripal_contact/includes/tripal_contact.chado_node.inc

@@ -16,13 +16,11 @@ function tripal_contact_node_info() {
 
   return array(
     'chado_contact' => array(
-      'name' => t('Contact'),
-      'base' => 'chado_contact',
+      'name'        => t('Contact'),
+      'base'        => 'chado_contact',
       'description' => t('A contact from the Chado database'),
-      'title_label' => t('Article Title'),
-      'body_label' => t('Abstract'),
-      'has_title' => TRUE,
-      'has_body' => FALSE,
+      'has_title'   => TRUE,
+      'locked'      => TRUE,
       'chado_node_api' => array(
         'base_table' => 'contact',
         'hook_prefix' => 'chado_contact',

+ 17 - 3
tripal_contact/tripal_contact.install

@@ -230,7 +230,21 @@ function tripal_contact_add_custom_tables(){
  */
 function tripal_contact_update_7000() {
 
-  tripal_contact_add_cvs();
-  tripal_contact_add_cvterms();
-
+  // add the new contact_relationship_types vocabulary
+  // We cannot use the Tripal API calls in the 7000 update 
+  // because during upgrade the tripal_core should also be disabled
+  try {
+    $check = db_query("SELECT cv_id FROM chado.cv WHERE name = 'contact_relationship_types'")->fetchObject();
+    if (!$check->cv_id) {
+      $sql = "INSERT INTO chado.cv (name, definition) VALUES (
+        'contact_relationship_types',
+        'Contains Types of relationships between contacts.')
+      ";
+      db_query($sql);
+    }
+  }
+  catch (\PDOException $e) {
+    $error = $e->getMessage();
+    throw new DrupalUpdateException('Failed to add contact_relationship_types vocabulary: '. $error);
+  }
 }

+ 1 - 1
tripal_core/api/tripal_core.chado_nodes.api.inc

@@ -101,7 +101,7 @@ function chado_get_nid_from_id($table, $id) {
         'base' => 'chado_example',
         'description' => t('A Chado example is a collection of material that can be sampled and have experiments performed on it.'),
         'has_title' => TRUE,
-        'has_body' => FALSE,
+        'locked' => TRUE,
 
         // this is what differs from the regular Drupal-documented hook_node_info()
         'chado_node_api' => array(

+ 0 - 27
tripal_core/api/tripal_core.tripal.api.inc

@@ -177,31 +177,4 @@ function tripal_set_message($message, $importance = TRIPAL_INFO, $options = arra
   else {
     drupal_set_message($full_message, 'tripal-site-admin-only');
   }
-
-}
-
-/**
- * Use this function to encapsulate text intended to be
- * visible only by the site administrator. A small tripal logo
- * appears alongside the text.  Do not call this function directly, but
- * rather, use the theme() function:
- *
- *   theme('tripal_admin_message', array('message' => $my_message));
- *
- * @param $message
- *   The message to be displayed to the site administrator
- *
- * @ingroup tripal_api
- */
-function theme_tripal_admin_message($variables) {
-
-  $message = $variables['message'];
-
-  if (!user_access('access administration pages')) {
-    return '';
-  }
-  return "
-    <div class=\"tripal-site-admin-only\">
-      <div class=\"tripal-site-admin-message\">$message</div>
-    </div>";
 }

+ 2 - 1
tripal_core/tripal_core.module

@@ -645,7 +645,8 @@ function tripal_core_node_view_alter(&$build) {
             site's default theme, edit then " .
             l('clear the Drupal cache', 'admin/config/development/performance', array('attributes' => array('target' => '_blank'))) . ".
             Currently, the content above is provided by this template: <br><br>$path",
-            TRIPAL_INFO, array('return_html' => 1)
+            TRIPAL_INFO, 
+            array('return_html' => 1)
           );
         }
 

+ 2 - 4
tripal_example/includes/tripal_example.chado_node.inc

@@ -17,12 +17,10 @@ function tripal_example_node_info() {
   $nodes = array();
 
   //$nodes['chado_example'] = array(
-  //  'name'        => t('example'),
+  //  'name'        => t('Example'),
   //  'base'        => 'chado_example',
   //  'description' => t('A example from the chado database'),
-  //  'title_label' => t('example'),
-  //  'has_title'   => FALSE,
-  //  'has_body'    => FALSE,
+  //  'has_title'   => TRUE,
   //  'locked'      => TRUE
   // This section of the node type array specifies how Tripal will sync the node
   // types with data in Chado. When Drupal creates a node it has no way of

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

@@ -19,10 +19,7 @@ function tripal_feature_node_info() {
     'name'        => t('Feature'),
     'base'        => 'chado_feature',
     'description' => t('A feature from the chado database'),
-    'has_title'   => FALSE,
-    'title_label' => t('Feature'),
-    'has_body'    => FALSE,
-    'body_label'  => t('Feature Description'),
+    'has_title'   => TRUE,
     'locked'      => TRUE,
     'chado_node_api' => array(
       'base_table' => 'feature',

+ 4 - 5
tripal_feature/includes/tripal_feature.seq_extract.inc

@@ -45,12 +45,11 @@ function tripal_feature_seq_extract_page() {
   // generate the search form
   $output .= '';
   if (user_access('access administration pages')) {
-    $output .= theme('tripal_admin_message', array('message' => "
-        Administrators, the " . l('organism_feature_count', 'admin/tripal/schema/mviews') . " and
-        " . l('analysis_organism', 'admin/tripal/schema/mviews') . " materialized
+    $output .= tripal_set_message("Administrators, the " . 
+        l('organism_feature_count', 'admin/tripal/schema/mviews') . " and " .
+        l('analysis_organism', 'admin/tripal/schema/mviews') . " materialized
         views must be populated before using this form.  Those views should be re-populated
-        when new data is added."
-    ));
+        when new data is added.");
   }
   $output .= "<div id=\"tripal-feature-seq-extract-form-block\">";
   $output .= drupal_get_form('tripal_feature_seq_extract_form');

+ 10 - 8
tripal_feature/theme/tripal_organism/tripal_organism_feature_browser.tpl.php

@@ -71,11 +71,12 @@ if ($enabled) {
     $rows = array();
     
     // let admins know they can customize the terms that appear in the list
-    print theme('tripal_admin_message', array('message' => "
-      Administrators, you can specify the feature types that should appear in 
-      this browser or remove it from the list of resources by navigating to the ". 
-      l("Tripal feature settings page", "admin/tripal/chado/tripal_feature/configuration", array('attributes' => array('target' => '_blank')))
-    ));
+    print tripal_set_message("Administrators, you can specify the feature types ".
+      "that should appear in this browser or remove it from the list of resources ".
+      "by navigating to the ".
+      l("Tripal feature settings page", "admin/tripal/chado/tripal_feature/configuration", array('attributes' => array('target' => '_blank'))),
+      TRIPAL_INFO,
+      array('return_html' => 1));
     
     foreach ($features as $feature){
       $fname =  $feature->name;
@@ -125,7 +126,7 @@ if ($enabled) {
   } 
   else {  ?>
     <p>There are no results.</p><?php
-    print theme('tripal_admin_message', array('message' => "
+    print tripal_set_message("
       Administrators, perform the following to show features in this browser:
       <ul>
         <li>Load features for this organism using the " .
@@ -144,8 +145,9 @@ if ($enabled) {
       that should appear in this browser or remove it from the list of resources by navigating to the " . 
       l("Tripal feature settings page", "admin/tripal/chado/tripal_feature/configuration", array('attributes' => array('target' => '_blank')))  . "
       </p>
-      The feature browser will not appear to site visitors unless features are present. "
-    ));
+      The feature browser will not appear to site visitors unless features are present. ",
+      TRIPAL_INFO,
+      array('return_html' => 1));
   }
 }
 

+ 62 - 32
tripal_feature/theme/tripal_organism/tripal_organism_feature_counts.tpl.php

@@ -14,52 +14,82 @@ if(property_exists($organism, 'feature_counts')) {
 if ($enabled) { 
   if (count($types) > 0){ ?>
     <div class="tripal_organism-data-block-desc tripal-data-block-desc">The following data types are currently present for this organism</div> <?php
+    
     // let admins know they can customize the terms that appear in the list
-    print theme('tripal_admin_message', array('message' => "
-      Administrators, you can customize the types of terms that appear in this report by 
-      navigating to the " . l('Tripal feature configuration page', 'admin/tripal/chado/tripal_feature/configuration') . "
+    print tripal_set_message("
+      Administrators, you can customize the types of terms that appear in this report by navigating to the " . 
+      l('Tripal feature configuration page', 'admin/tripal/chado/tripal_feature/configuration', array('attributes' => array('target' => '_blank'))) . "
       opening the section \"Feature Summary Report\" and adding the list of
-      terms you want to appear in the list. You can rename terms as well.  To disable this report and 
-      remove it from the list of resources, navigate to the " . 
-      l('Tripal feature configuration page', 'admin/tripal/tripal_feature/configuration') . "
-      and hide the \"Feature Summary\". To refresh the data,re-populate the " .
-      l('organism_feature_count', 'admin/tripal/schema/mviews') . " materialized view.")
-    ); ?>
-    <table id="tripal_organism-table-feature_counts" class="tripal_organism-table tripal-table tripal-table-horz">     
-      <tr class="tripal_organism-table-odd-row tripal-table-even-row">
-        <th>Feature Type</th>
-        <th>Count</th>
-      </tr> <?php
-      for ($j = 0; $j < count($types); $j++) {
-        $type = $types[$j];
-        $name = $names[$j];
-        $class = 'tripal_organism-table-odd-row tripal-table-odd-row';
-        if ($i % 2 == 0 ) {
-         $class = 'tripal_organism-table-even-row tripal-table-even-row';
-        }?>
-        <tr class="<?php print $class ?>">
-          <td><span title="<?php print $type->definition ?>"><?php print $name?></span></td>
-          <td><?php print number_format($type->num_features) ?></td>
-        </tr> <?php
-        $i++;  
-      } ?>
-    </table>
+      terms you want to appear in the list. You can rename terms as well. To refresh the data,re-populate the " .
+      l('organism_feature_count', 'admin/tripal/schema/mviews', array('attributes' => array('target' => '_blank'))) . " 
+      materialized view.",
+      TRIPAL_INFO,
+      array('return_html' => 1)
+    ); 
+    
+    // the $headers array is an array of fields to use as the colum headers.
+    // additional documentation can be found here
+    // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
+    $headers = array('Feature Type' ,'Count');
+    
+    // the $rows array contains an array of rows where each row is an array
+    // of values for each column of the table in that row.  Additional documentation
+    // can be found here:
+    // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
+    $rows = array();
+    
+    for ($j = 0; $j < count($types); $j++) {
+      $type = $types[$j];
+      $name = $names[$j];
+      
+      $rows[] = array(
+        "<span title=\"" . $type->definition . "\">$name</span>",
+        number_format($type->num_features),
+      );
+    } 
+    // the $table array contains the headers and rows array as well as other
+    // options for controlling the display of the table.  Additional
+    // documentation can be found here:
+    // https://api.drupal.org/api/drupal/includes%21theme.inc/function/theme_table/7
+    $table = array(
+      'header' => $headers,
+      'rows' => $rows,
+      'attributes' => array(
+        'id' => 'tripal_organism-table-features',
+      ),
+      'sticky' => FALSE,
+      'caption' => '',
+      'colgroups' => array(),
+      'empty' => '',
+    );
+    // once we have our table array structure defined, we call Drupal's theme_table()
+    // function to generate the table.
+    print theme_table($table);
+    
+    ?>
+
     <img class="tripal_cv_chart" id="tripal_feature_cv_chart_<?php print $organism->organism_id?>" src="" border="0"><?php 
    } 
    else { 
     if (user_access('access administration pages')) { ?>
       <div class="tripal_organism-data-block-desc tripal-data-block-desc">The following data types are currently present for this organism</div> <?php 
-      print theme('tripal_admin_message', array('message' => "
+      print tripal_set_message("
          Administrators, to view the feature type report:
          <ul>
-            <li>Populate the " . l('organism_feature_count', 'admin/tripal/schema/mviews') ." materialized view</li>
+            <li>Populate the " . 
+                l('organism_feature_count', 'admin/tripal/schema/mviews', array('attributes' => array('target' => '_blank'))) ." 
+                materialized view</li>
             <li>Refresh this page</li>
          </ul> 
          To disable this report and remove it from the list of resources:
          <ul>
-           <li>Navigate to the " . l('Tripal feature configuration page', 'admin/tripal/chado/tripal_feature/configuration') ." and hide the \"Feature Summary\"</li>
+           <li>Navigate to the " . 
+               l('Tripal feature configuration page', 'admin/tripal/chado/tripal_feature/configuration', array('attributes' => array('target' => '_blank'))) ." 
+               and hide the \"Feature Summary\"</li>
           </ul>
-         </p>")
+         </p>",
+         TRIPAL_INFO,
+         array('return_html' => 1)
       );              
     }
   }

+ 4 - 7
tripal_featuremap/includes/tripal_featuremap.chado_node.inc

@@ -15,14 +15,11 @@
 function tripal_featuremap_node_info() {
   $nodes = array();
   $nodes['chado_featuremap'] = array(
-    'name' => t('Feature Map'),
-    'base' => 'chado_featuremap',
+    'name'        => t('Feature Map'),
+    'base'        => 'chado_featuremap',
     'description' => t('A map of features from the chado database (e.g. genetic map)'),
-    'has_title' => FALSE,
-    'title_label' => t('Feature Map'),
-    'has_body' => FALSE,
-    'body_label' => t('Feature Map Description'),
-    'locked' => TRUE,
+    'has_title'   => TRUE,
+    'locked'      => TRUE,
     'chado_node_api' => array(
       'base_table' => 'featuremap',
       'hook_prefix' => 'chado_featuremap',

+ 4 - 6
tripal_library/includes/tripal_library.chado_node.inc

@@ -15,13 +15,11 @@
 function tripal_library_node_info() {
   $nodes = array();
   $nodes['chado_library'] = array(
-    'name' => t('Library'),
-    'base' => 'chado_library',
+    'name'        => t('Library'),
+    'base'        => 'chado_library',
     'description' => t('A library from the chado database'),
-    'has_title' => FALSE,
-    'title_label' => t('Library'),
-    'has_body' => FALSE,
-    'locked' => TRUE,
+    'has_title'   => TRUE,
+    'locked'      => TRUE,
     'chado_node_api' => array(
       'base_table' => 'library',
       'hook_prefix' => 'chado_library',

+ 65 - 29
tripal_library/tripal_library.install

@@ -166,7 +166,7 @@ function tripal_library_add_mview_library_feature_count(){
 function tripal_library_add_cvs(){
   tripal_cv_add_cv(
     'library_property',
-    'Contains properties for libraries'
+    'Contains properties for libraries.'
   );
   tripal_cv_add_cv(
     'library_type',
@@ -244,36 +244,72 @@ function tripal_library_add_cvterms() {
 function tripal_library_update_7000() {
 
   // the library types were formerly in a vocabulary named 'tripal_library_types'.
-  // rename that to just be 'library_type'
-  $cv = tripal_cv_get_cv_by_name('tripal_library_types');
-  $match = array(
-    'cv_id' => $cv->cv_id
-  );
-  $values = array(
-    'name' => 'library_type'
-  );
-  $success = chado_update_record('cv', $match, $values);
-  if (!$success) {
-    throw new DrupalUpdateException('Failed to rename tripal_library_types CV.');
+  // rename that to just be 'library_type'. We cannot use the Tripal API calls 
+  // because during upgrade the tripal_core should also be disabled
+  try {
+    $check = db_query("SELECT cv_id FROM chado.cv WHERE name = 'library_type'")->fetchObject();
+    if (!$check->cv_id) {
+      $sql = "UPDATE chado.cv SET name = 'library_type' WHERE name = 'tripal_library_types'";
+      db_query($sql);
+    }
   }
-
-
+  catch (\PDOException $e) {
+    $error = $e->getMessage();
+    throw new DrupalUpdateException('Failed to change the vocabulary from tripal_library_types to library_type: '. $error);
+  }
+  
+  // add the library_property CV
+  try {
+    $check = db_query("SELECT cv_id FROM chado.cv WHERE name = 'library_property'")->fetchObject();
+    if (!$check->cv_id) {
+      $sql = "INSERT INTO chado.cv (name, definition) VALUES (
+        'library_property',
+        'Contains properties for libraries.')
+      ";
+      db_query($sql);
+    }
+  }
+  catch (\PDOException $e) {
+    $error = $e->getMessage();
+    throw new DrupalUpdateException('Failed to add library_property vocabulary: '. $error);
+  }
+  
+  // add the library_type CV
+  try {
+    $check = db_query("SELECT cv_id FROM chado.cv WHERE name = 'library_type'")->fetchObject();
+    if (!$check->cv_id) {
+      $sql = "INSERT INTO chado.cv (name, definition) VALUES (
+        'library_type',
+        'Contains terms for types of libraries (e.g. BAC, cDNA, FOSMID, etc).')
+      ";  
+      db_query($sql);
+    }
+  }
+  catch (\PDOException $e) {
+    $error = $e->getMessage();
+    throw new DrupalUpdateException('Failed to add library_type vocabulary: '. $error);
+  }
+  
   // For Tripal in Drupal 6 the library_description cvterm was stored in the
   // 'tripal' CV.  It should be stored in the new library_property CV that
   // is added by this module for Tripal 2.0 and Drupal 7.  So, we need to
-  // reset the CV ID for that term and rename the term to 'Library Description'
-  tripal_library_add_cvs();
-  $cv = tripal_cv_get_cv_by_name('library_property');
-  $cvterm = tripal_cv_get_cvterm_by_name('library_description');
-  $match = array(
-    'cvterm_id' => $cvterm->cvterm_id,
-  );
-  $values = array(
-    'cv_id' => $cv->cv_id,
-    'name' => 'Library Description',
-  );
-  chado_update_record('cvterm', $match, $values);
-  if (!$success) {
-    throw new DrupalUpdateException('Failed to move library properties to new library_property CV.');
+  // reset the CV ID for that term and rename the term to 'Library Description' 
+  // We cannot use the Tripal API calls in the 7000 update 
+  // because during upgrade the tripal_core should also be disabled
+  $sql = "
+    UPDATE chado.cvterm 
+    SET 
+      name = 'Library Description',
+      cv_id = (SELECT cv_id FROM chado.cv WHERE name = 'library_property')
+    WHERE 
+      name = 'library_description' AND
+      cv_id = (SELECT cv_id FROM chado.cv WHERE name = 'tripal')
+  ";
+  try {
+    db_query($sql);
   }
-}
+  catch (\PDOException $e) {
+    $error = $e->getMessage();
+    throw new DrupalUpdateException('Failed to change library_description property type to the library_property CV and update the name: '. $error);
+  }
+}

+ 4 - 5
tripal_organism/includes/tripal_organism.chado_node.inc

@@ -15,12 +15,11 @@
 function tripal_organism_node_info() {
   $nodes = array();
   $nodes['chado_organism'] = array(
-    'name' => t('Organism'),
-    'base' => 'chado_organism',
+    'name'        => t('Organism'),
+    'base'        => 'chado_organism',
     'description' => t('An organism'),
-    'has_title' => FALSE,
-    'title_label' => t('Organism'),
-    'locked' => TRUE,
+    'has_title'   => TRUE,
+    'locked'      => TRUE,
     'chado_node_api' => array(
       'base_table' => 'organism',
       'hook_prefix' => 'chado_organism',

+ 17 - 2
tripal_organism/tripal_organism.install

@@ -131,6 +131,21 @@ function tripal_organism_add_cvterms() {
  */
 function tripal_organism_update_7000() {
 
-  tripal_organism_add_cvs();
-  tripal_organism_add_cvterms();
+  // add the new organism_property vocabulary
+  // We cannot use the Tripal API calls in the 7000 update 
+  // because during upgrade the tripal_core should also be disabled
+  try {
+    $check = db_query("SELECT cv_id FROM chado.cv WHERE name = 'organism_property'")->fetchObject();
+    if (!$check->cv_id) {
+      $sql = "INSERT INTO chado.cv (name, definition) VALUES (
+        'organism_property',
+        'Contains properties for organisms.')
+      ";
+      db_query($sql);
+    }
+  }
+  catch (\PDOException $e) {
+    $error = $e->getMessage();
+    throw new DrupalUpdateException('Failed to add organism_property vocabulary: '. $error);
+  }
 }

+ 4 - 6
tripal_project/includes/tripal_project.chado_node.inc

@@ -16,13 +16,11 @@
 function tripal_project_node_info() {
   return array(
     'chado_project' => array(
-      'name' => t('Project'),
-      'base' => 'chado_project',
+      'name'        => t('Project'),
+      'base'        => 'chado_project',
       'description' => t('A project from the Chado database'),
-      'has_title' => TRUE,
-      'title_label' => t('Project Name'),
-      'had_body' => TRUE,
-      'body_label' => t('Full Description'),
+      'has_title'   => TRUE,
+      'locked'      => TRUE,
       'chado_node_api' => array(
         'base_table' => 'project',
         'hook_prefix' => 'chado_project',

+ 32 - 30
tripal_project/tripal_project.install

@@ -124,21 +124,6 @@ function tripal_project_add_cvterms() {
     ),
     'project_property', 0, 1, 'tripal'
   );
-
-  tripal_cv_add_cvterm(
-    array(
-      'name' => 'Project Type',
-      'def'  => 'The short few word description of the type of project.'
-    ),
-   'project_property', 0, 1, 'tripal'
-  );
-  tripal_cv_add_cvterm(
-    array(
-      'name' => 'Funding Source',
-      'def'  => 'The funding source for this project.'
-    ),
-    'project_property', 0, 1, 'tripal'
-  );
 }
 
 /**
@@ -147,25 +132,42 @@ function tripal_project_add_cvterms() {
  * @ingroup tripal_project
  */
 function tripal_project_update_7000() {
+  
+  // add the project_property CV
+  try {
+    $check = db_query("SELECT cv_id FROM chado.cv WHERE name = 'project_property'")->fetchObject();
+    if (!$check->cv_id) {
+      $sql = "INSERT INTO chado.cv (name, definition) VALUES (
+        'project_property','Contains properties for projects.')
+      ";
+      db_query($sql);
+    }
+  }
+  catch (\PDOException $e) {
+    $error = $e->getMessage();
+    throw new DrupalUpdateException('Failed to add project_property vocabulary: '. $error);
+  }
 
   // For Tripal in Drupal 6 the project_description cvterm was stored in the
   // 'tripal' CV.  It should be stored in the new project_property CV that
   // is added by this module for Tripal 2.0 and Drupal 7.  So, we need to
   // reset the CV ID for that term and rename the term to 'Project Description'
-  tripal_project_add_cvs();
-  $cv = tripal_cv_get_cv_by_name('project_property');
-  $cvterm = tripal_cv_get_cvterm_by_name('project_description', $cv->cv_id);
-  $match = array(
-    'cvterm_id' => $cvterm->cvterm_id,
-  );
-  $values = array(
-    'name'  => 'Project Description',
-  );
-  chado_update_record('cvterm', $match, $values);
-  if (!$success) {
-    throw new DrupalUpdateException('Failed to move project properties to new project_property CV.');
+  // We cannot use the Tripal API calls'because during upgrade the tripal_core
+  // should also be disabled
+  $sql = "
+    UPDATE chado.cvterm CVT
+    SET
+      name = 'Project Description',
+      cv_id = (SELECT cv_id FROM chado.cv WHERE name = 'project_property')
+    WHERE
+      name = 'project_description' AND
+      cv_id = (SELECT cv_id FROM chado.cv WHERE name = 'tripal')
+  ";
+  try {
+    db_query($sql);
+  }
+  catch (\PDOException $e) {
+    $error = $e->getMessage();
+    throw new DrupalUpdateException('Failed to change project_description property type to the project_property CV and update the name: '. $error);
   }
-
-  // add in new CVterms
-  tripal_project_add_cvterms();
 }

+ 4 - 6
tripal_pub/includes/tripal_pub.chado_node.inc

@@ -13,13 +13,11 @@ function tripal_pub_node_info() {
 
   return array(
     'chado_pub' => array(
-      'name' => t('Publication'),
-      'base' => 'chado_pub',
+      'name'        => t('Publication'),
+      'base'        => 'chado_pub',
       'description' => t('A publication from the Chado database'),
-      'title_label' => t('Article Title'),
-      'body_label' => t('Abstract'),
-      'has_title' => TRUE,
-      'has_body' => FALSE,
+      'has_title'   => TRUE,
+      'locked'      => TRUE,
       'chado_node_api' => array(
         'base_table' => 'pub',
         'hook_prefix' => 'chado_pub',

+ 6 - 5
tripal_pub/includes/tripal_pub.pub_search.inc

@@ -171,11 +171,12 @@ function tripal_pub_search_form($form, &$form_state) {
   );
 
   $form['admin-instructions'] = array(
-    '#markup'  =>  theme('tripal_admin_message', array('message' =>
-      t('Administrators, you can select the fields with which a user can use to search,
-         by checking the desired fields on the ' .
-         l('Publication Module Settings Page', 'admin/tripal/chado/tripal_pub/configuration'). ' in
-        the section titled "Search Options".  The selected fields will appear in the dropdowns below.'))),
+    '#markup'  =>  tripal_set_message( 
+      t('Administrators, you can select the fields with which a user can use to search, by checking the desired fields on the ' .
+        l('Publication Module Settings Page', 'admin/tripal/chado/tripal_pub/configuration', array('attributes' => array('target' => '_blank'))) . ' 
+        in the section titled "Search Options".  The selected fields will appear in the dropdowns below.'),
+      TRIPAL_INFO,
+      array('return_html' => 1)),
   );
   $form['instructions'] = array(
     '#markup'  =>  t('To search for publications enter keywords in the text boxes below.

+ 17 - 2
tripal_pub/tripal_pub.install

@@ -247,6 +247,21 @@ function tripal_pub_add_cvterms() {
  */
 function tripal_pub_update_7000() {
 
-  tripal_pub_add_cvs();
-  tripal_pub_add_cvterms();
+  // add the new pub_relationship_types vocabulary
+  // We cannot use the Tripal API calls in the 7000 update 
+  // because during upgrade the tripal_core should also be disabled
+  try {
+    $check = db_query("SELECT cv_id FROM chado.cv WHERE name = 'pub_relationship_types'")->fetchObject();
+    if (!$check->cv_id) {
+      $sql = "INSERT INTO chado.cv (name, definition) VALUES (
+        'pub_relationship_types',
+        'Contains Types of relationships between publications.')
+      ";
+      db_query($sql);
+    }
+  }
+  catch (\PDOException $e) {
+    $error = $e->getMessage();
+    throw new DrupalUpdateException('Failed to add pub_relationship_types vocabulary: '. $error);
+  }
 }

+ 4 - 4
tripal_stock/includes/tripal_stock.chado_node.inc

@@ -15,11 +15,11 @@
 function tripal_stock_node_info() {
   return array(
     'chado_stock' => array(
-      'name' => t('Stock'),
-      'base' => 'chado_stock',
+      'name'        => t('Stock'),
+      'base'        => 'chado_stock',
       'description' => t('A Chado Stock is a collection of material that can be sampled and have experiments performed on it.'),
-      'has_title' => TRUE,
-      'has_body' => FALSE,
+      'has_title'   => TRUE,
+      'locked'      => TRUE,
       'chado_node_api' => array(
         'base_table' => 'stock',
         'hook_prefix' => 'chado_stock',