Browse Source

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

Stephen Ficklin 7 years ago
parent
commit
12818e82f3

+ 1 - 1
legacy/tripal_library/theme/templates/tripal_library_base.tpl.php

@@ -12,7 +12,7 @@ $property = array(
   'cv_name' => 'library_property'
 );
 $libprop = chado_get_property($record, $property);
-$description = $libprop->value; ?>
+$description = isset($libprop->value) ? $libprop->value : ''; ?>
 
 <div class="tripal_library-data-block-desc tripal-data-block-desc"></div> <?php 
 

+ 3 - 0
legacy/tripal_library/theme/templates/tripal_library_properties.tpl.php

@@ -4,6 +4,9 @@ $library = $variables['node']->library;
 $options = array('return_array' => 1);
 $library = chado_expand_var($library, 'table', 'libraryprop', $options);
 $props = $library->libraryprop;
+if (!$props) {
+  return;
+}
 
 // iterate through the properties and remove the 'library_description' as it is
 // already displayed on the base template.

+ 14 - 2
legacy/tripal_pub/includes/tripal_pub.pub_search.inc

@@ -67,8 +67,20 @@ function tripal_pub_search_page() {
       // if we have the citation then use it, otherwise, just use the title
       $title = htmlspecialchars($pub->title);
       $result = $title;
-      if ($pub->nid) {
-        $result = l($title ,'node/' . $pub->nid, array('attributes' => array('target' => '_blank')));
+      $link = NULL;
+      // tripal v2 link (node)
+      $nid = chado_get_nid_from_id ('pub', $pub->pub_id);
+      if ($nid) {
+        $link = "/node/$nid";
+      }
+      // try tripal v3 link (entity), if it exists, update the link to entity
+      $entity_id = tripal_get_chado_entity_id ('pub', $pub->pub_id);
+      if ($entity_id) {
+        $link = "/bio_data/$entity_id";
+      }
+      
+      if ($link) {
+        $result = l($title , $link, array('attributes' => array('target' => '_blank')));
       }
       if ($citation_rec->value) {
         $citation = htmlspecialchars($citation_rec->value);

+ 3 - 0
tripal_bulk_loader/includes/tripal_bulk_loader.chado_node.inc

@@ -189,6 +189,9 @@ function tripal_bulk_loader_load($nodes) {
   );
   foreach ($result as $record) {
     $record->num_inserted = sizeof(preg_split('/,/', $record->ids_inserted));
+    if(!isset($nodes[$record->nid]->inserted_records)) {
+      $nodes[$record->nid]->inserted_records = new stdClass();
+    }
     $nodes[$record->nid]->inserted_records->{$record->table_inserted_into} = $record;
   }
 

+ 1 - 1
tripal_chado/api/modules/tripal_chado.organism.api.inc

@@ -145,7 +145,7 @@ function tripal_get_organism_select_options($syncd_only = TRUE) {
   if ($syncd_only) {
     $sql = "
       SELECT *
-      FROM {chado_organism} CO
+      FROM [chado_organism] CO
         INNER JOIN {organism} O ON O.organism_id = CO.organism_id
       ORDER BY O.genus, O.species
     ";

+ 1 - 1
tripal_chado/api/modules/tripal_chado.pub.api.inc

@@ -1018,7 +1018,7 @@ function tripal_get_minimal_pub_info($pub) {
   }
 
   // Chado has a null pub as default.  We don't return anything for this.
-  if ($pub->uniquename == 'null') {
+  if (isset($pub->uniquename) && $pub->uniquename == 'null') {
     return array();
   }