浏览代码

PHP error and bug fixes for pub module

Stephen Ficklin 11 年之前
父节点
当前提交
8a2bd34a57
共有 3 个文件被更改,包括 9 次插入8 次删除
  1. 4 3
      tripal_core/includes/jobs.inc
  2. 1 1
      tripal_pub/api/tripal_pub.api.inc
  3. 4 4
      tripal_pub/tripal_pub.module

+ 4 - 3
tripal_core/includes/jobs.inc

@@ -173,9 +173,10 @@ function tripal_jobs_report() {
     
   // create the report page
   $output = "Waiting jobs are executed first by priority level (the lower the " .
-             "number the higher the priority) and second by the order they " .
-             "were entered";  
-  $output .= drupal_render(drupal_get_form('tripal_jobs_report_form'));   
+            "number the higher the priority) and second by the order they " .
+            "were entered";
+  $report_form = drupal_get_form('tripal_jobs_report_form');
+  $output .= drupal_render($report_form);   
   $output .= theme_table($table);
   $output .= theme('pager');
   return $output;

+ 1 - 1
tripal_pub/api/tripal_pub.api.inc

@@ -694,7 +694,7 @@ function tripal_pub_add_publication($pub_details, &$action, $do_contact = FALSE,
   $values = array(
     'title'       => $pub_details['Title'],
     'volume'      => $pub_details['Volume'],
-    'series_name' => $pub_details['Journal Name'],
+    'series_name' => substr($pub_details['Journal Name'], 0, 255),
     'issue'       => $pub_details['Issue'],
     'pyear'       => $pub_details['Year'],
     'pages'       => $pub_details['Pages'],

+ 4 - 4
tripal_pub/tripal_pub.module

@@ -488,7 +488,7 @@ function chado_pub_insert($node) {
     // insert the pub record
     $values = array(
       'title'       => trim($node->pubtitle),
-      'series_name' => trim($node->series_name),
+      'series_name' => substr(trim($node->series_name), 0, 255),
       'type_id'     => trim($node->type_id),
       'pyear'       => trim($node->pyear),
       'is_obsolete' => $node->is_obsolete ? 'true' : 'false', 
@@ -497,9 +497,9 @@ function chado_pub_insert($node) {
       'volume'      => $volume,    
       'issue'       => $issue,    
       'pages'       => $pages,
-      'miniref'     => $miniref,        
-      'publisher'   => $publisher,
-      'pubplace'    => $pubplace,
+      'miniref'     => substr($miniref, 0, 255),        
+      'publisher'   => substr($publisher, 0, 255),
+      'pubplace'    => substr($pubplace, 0, 255),
     );
     $pub = tripal_core_chado_insert('pub', $values);
     if (!$pub) {