Browse Source

A few views bug fixes

Lacey Sanderson 11 years ago
parent
commit
68a094ace0

+ 1 - 0
tripal_library/tripal_library.views_default.inc

@@ -178,6 +178,7 @@ function tripal_library_admin_defaultviews_library() {
   $handler->display->display_options['filters']['type_id']['id'] = 'type_id';
   $handler->display->display_options['filters']['type_id']['table'] = 'library';
   $handler->display->display_options['filters']['type_id']['field'] = 'type_id';
+  $handler->display->display_options['filters']['type_id']['value'] = 'All';
   $handler->display->display_options['filters']['type_id']['group'] = '0';
   $handler->display->display_options['filters']['type_id']['exposed'] = TRUE;
   $handler->display->display_options['filters']['type_id']['expose']['operator_id'] = 'type_id_op';

+ 23 - 21
tripal_organism/tripal_organism.module

@@ -199,32 +199,20 @@ function tripal_organism_theme($existing, $type, $theme, $path) {
   );
   return $items;
 }
-/**
- * 
- * @param $node
- */
-function tripal_organism_node_presave($node) {
-  switch ($node->type) {
-    case 'chado_organism':
-      // set the title for the node
-      $node->title = "$node->genus $node->species";
-      break;
-  }
-}
 /**
  *
  * @ingroup tripal_feature
  */
 function tripal_organism_node_view($node, $view_mode, $langcode) {
   switch ($node->type) {
-    case 'chado_organism':
-      // Show feature browser and counts
-      if ($view_mode == 'full') {
-        $node->content['tripal_organism_base'] = array(
-          '#value' => theme('tripal_organism_base', array('node' => $node)),
-        );
-      }
-      break;
+  	case 'chado_organism':
+  	  // Show feature browser and counts
+  	  if ($view_mode == 'full') {
+  	    $node->content['tripal_organism_base'] = array(
+  	      '#value' => theme('tripal_organism_base', array('node' => $node)),
+  	    );
+  	  }
+  	  break;
   }
 }
 /**
@@ -269,7 +257,7 @@ function tripal_organism_permission() {
  */
 function tripal_organism_views_api() {
   return array(
-    'api' => 2.0,
+    'api' => 3.0,
   );
 }
 /**
@@ -440,6 +428,13 @@ function chado_organism_insert($node) {
     drupal_write_record('chado_organism', $record);
   }
 
+  // set the title for the node
+  $record = new stdClass();
+  $record->title = "$node->genus $node->species";
+  $record->nid = $node->nid;
+  drupal_write_record('node', $record, 'nid');
+  drupal_write_record('node_revisions', $record, 'nid');
+
   // add the image
   chado_organism_add_image($node);
 }
@@ -472,6 +467,13 @@ function chado_organism_update($node) {
   );
   $org_status = tripal_core_chado_update('organism', $match, $values);
 
+  // set the title for the node
+  $record = new stdClass();
+  $record->title = "$node->genus $node->species";
+  $record->nid = $node->nid;
+  drupal_write_record('node', $record, 'nid');
+  drupal_write_record('node_revisions', $record, 'nid');
+
   // add the image
   chado_organism_add_image($node);
 }