Browse Source

Fixed addition of body field to content types which are present after an update

Stephen Ficklin 11 years ago
parent
commit
44b681ede3

+ 5 - 1
tripal_contact/tripal_contact.module

@@ -262,8 +262,12 @@ function tripal_contact_permission() {
  * @ingroup tripal_contact
  */
 function tripal_contact_form_alter(&$form, &$form_state, $form_id) {
-  // turn of preview button for insert/updates
+
   if ($form_id == "chado_contact_node_form") {
+    // turn of preview button for insert/updates
     $form['actions']['preview']['#access'] = FALSE;
+    
+    //remove the body field
+    unset($form['body']);
   }
 }

+ 2 - 2
tripal_core/api/tripal_core.chado_query.api.inc

@@ -1407,8 +1407,8 @@ function chado_pager_query($query, $args, $limit, $element, $count_query = '') {
 function chado_pager_get_count($element) {
   $q = $_GET['q'];
   
-  if (array_key_exists($q, $_SESSION['chado_pager']) and 
-      array_key_exists($element, $_SESSION['chado_pager'][$q])) {
+  if (array_key_exists($q, $GLOBALS['chado_pager']) and 
+      array_key_exists($element, $GLOBALS['chado_pager'][$q])) {
     return $GLOBALS['chado_pager'][$q][$element]['total_records'];
   }
   else {

+ 7 - 2
tripal_core/tripal_core.module

@@ -565,12 +565,17 @@ function tripal_core_node_view_alter(&$build) {
   // make some changes to each block of content so that we can associate
   // a table of contents and add administrator and curator messages
   if (preg_match('/chado_/', $node->type)) {
-
+    
     // iterate through all the elements of the $build array and for those
     // that are wanting to provide content for this node
     $markup = array();
     foreach ($build as $key => $value) {
-
+      
+      // skip the body element as the Tripal node types do not use it
+      if ($key == 'body') {
+        continue;
+      }
+      
       // examine elements without a '#' prefix as these should be adding
       // contents to the page. Skip the table of contents and links as those
       // will be placed elsewhere

+ 5 - 1
tripal_example/tripal_example.module

@@ -239,8 +239,12 @@ function tripal_example_cron() {
  * @param $form_id
  */
 function tripal_example_form_alter(&$form, &$form_state, $form_id) {
-  // turn of preview button for insert/updates
+
   if ($form_id == "chado_example_node_form") {
+    // turn of preview button for insert/updates
     $form['actions']['preview']['#access'] = FALSE;
+    
+    //remove the body field
+    unset($form['body']);
   }
 }

+ 4 - 0
tripal_feature/tripal_feature.module

@@ -1201,6 +1201,10 @@ function tripal_feature_form_alter(&$form, &$form_state, $form_id) {
   }
   // turn off preview button for insert/updates
   if ($form_id == "chado_feature_node_form") {
+    // turn of preview button for insert/updates
     $form['actions']['preview']['#access'] = FALSE;
+    
+    //remove the body field
+    unset($form['body']);
   }
 }

+ 5 - 1
tripal_featuremap/tripal_featuremap.module

@@ -302,8 +302,12 @@ function tripal_featuremap_block_view($delta = '') {
  * @ingroup tripal_featuremap
  */
 function tripal_featuremap_form_alter(&$form, &$form_state, $form_id) {
-  // turn of preview button for insert/updates
+
   if ($form_id == "chado_featuremap_node_form") {
+    // turn of preview button for insert/updates
     $form['actions']['preview']['#access'] = FALSE;
+    
+    //remove the body field
+    unset($form['body']);
   }
 }

+ 3 - 0
tripal_genetic/theme/tripal_stock/tripal_stock_genotypes.tpl.php

@@ -25,6 +25,9 @@ $options = array(
     'limit' => $num_results_per_page, 
     'element' => $stock_pager_id
   ),
+  'fk_include' => array(
+    'genotype_id' => 1
+  );
 );
 $stock = tripal_core_expand_chado_vars($stock, 'table', 'stock_genotype', $options); 
 $stock_genotypes = $stock->stock_genotype;

+ 4 - 2
tripal_library/theme/tripal_library/tripal_library_terms.tpl.php

@@ -8,8 +8,10 @@ $terms = $library->library_cvterm;
 
 // order the terms by CV
 $s_terms = array();
-foreach ($terms as $term) {
-  $s_terms[$term->cvterm_id->cv_id->name][] = $term;  
+if ($terms) {
+  foreach ($terms as $term) {
+    $s_terms[$term->cvterm_id->cv_id->name][] = $term;  
+  }
 }
 
 if (count($s_terms) > 0) { ?>

+ 5 - 1
tripal_library/tripal_library.module

@@ -310,8 +310,12 @@ function tripal_library_block_view($delta = '') {
  * @ingroup tripal_library
  */
 function tripal_library_form_alter(&$form, &$form_state, $form_id) {
-  // turn of preview button for insert/updates
+  
   if ($form_id == "chado_library_node_form") {
+    // turn of preview button for insert/updates
     $form['actions']['preview']['#access'] = FALSE;
+    
+    //remove the body field
+    unset($form['body']);
   }
 }

+ 1 - 0
tripal_organism/includes/tripal_organism.chado_node.inc

@@ -523,6 +523,7 @@ function tripal_organism_node_presave($node) {
 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(

+ 1 - 1
tripal_organism/theme/tripal_organism/tripal_organism_base.tpl.php

@@ -9,7 +9,7 @@ $organism = tripal_core_expand_chado_vars($organism,'field','organism.comment');
 $image = '';
 $image_url = tripal_organism_get_image_url($organism, $node->nid); 
 if ($image_url) {
-  $image = "<img src=\"$image_url\">";
+  $image = "<img class=\"tripal-organism-img\" src=\"$image_url\">";
 }
 
 // the $headers array is an array of fields to use as the colum headers. 

+ 2 - 0
tripal_organism/tripal_organism.info

@@ -6,5 +6,7 @@ package = Tripal
 version = 7.x-2.0a
 configure = admin/tripal/chado/tripal_organism
 
+stylesheets[all][] = theme/css/tripal_organism.css
+
 dependencies[] = tripal_core
 dependencies[] = tripal_views

+ 5 - 1
tripal_organism/tripal_organism.module

@@ -252,8 +252,12 @@ function tripal_organism_job_describe_args($callback, $args) {
  * @ingroup tripal_organism
  */
 function tripal_organism_form_alter(&$form, &$form_state, $form_id) {
-  // turn of preview button for insert/updates
   if ($form_id == "chado_organism_node_form") {
+    
+    // turn of preview button for insert/updates
     $form['actions']['preview']['#access'] = FALSE;
+    
+    //remove the body field
+    unset($form['body']);
   }
 }

+ 5 - 1
tripal_project/tripal_project.module

@@ -265,8 +265,12 @@ function tripal_project_block_view($delta = '') {
  * @ingroup tripal_project
  */
 function tripal_project_form_alter(&$form, &$form_state, $form_id) {
-  // turn of preview button for insert/updates
+
   if ($form_id == "chado_project_node_form") {
+    // turn of preview button for insert/updates
     $form['actions']['preview']['#access'] = FALSE;
+    
+    //remove the body field
+    unset($form['body']);
   }
 }

+ 4 - 0
tripal_pub/tripal_pub.module

@@ -371,7 +371,11 @@ function tripal_pub_mail($key, &$message, $params) {
 function tripal_pub_form_alter(&$form, &$form_state, $form_id) {
   // turn of preview button for insert/updates
   if ($form_id == "chado_pub_node_form") {
+    // turn of preview button for insert/updates
     $form['actions']['preview']['#access'] = FALSE;
+    
+    //remove the body field
+    unset($form['body']);
   }
   if ($form_id == "tripal_pub_importer_setup_form") {
 /*    // updating the form through the ahah callback sets the action of

+ 4 - 1
tripal_stock/tripal_stock.module

@@ -520,8 +520,11 @@ function tripal_stock_match_stocks_page($id) {
  * @ingroup tripal_stock
  */
 function tripal_stock_form_alter(&$form, &$form_state, $form_id) {
-  // turn of preview button for insert/updates
   if ($form_id == "chado_stock_node_form") {
+    // turn of preview button for insert/updates
     $form['actions']['preview']['#access'] = FALSE;
+    
+    //remove the body field
+    unset($form['body']);
   }
 }