[Rt-devel] Bulk Ticket Update - bug report and patch (RT 3.4.2)

Stephen Turner sturner at MIT.EDU
Thu Mar 30 14:49:19 EST 2006

If you use the default textarea wrap attribute of 'hard' and your 
signature contains a line that's longer than the reply/comment box on 
the bulk update page, additional newline characters are inserted into 
the middle of the signature when the form is submitted.

This causes a comment to be appended to the tickets even if the 
message box was left alone; the additional characters mean that the 
user's signature and the message box contents no longer match.

This patch fixes the problem - it strips all newline characters from 
(copies of) the message box input and the signature before comparing, 
so the wrap setting no longer affects the comparison.

Additionally - I removed the chomp of the message box contents. It 
seems superfluous, and the Reply/Comment screen doesn't do it.

If this is acceptable, I can supply similar patches for other parts 
of the system (e.g. the Reply/Comment screen)


--- share/html/Search/Bulk.html 2006-02-14 15:53:10.000000000 -0500
+++ local/html/Search/Bulk.html 2006-03-30 14:27:49.000000000 -0500
@@ -215,12 +215,16 @@
  my $do_comment_reply=0;
  # Prepare for ticket updates
  $ARGS{'UpdateContent'} =~ s/\r\n/\n/g;
-chomp ($ARGS{'UpdateContent'}) ;
+my $content = $ARGS{'UpdateContent'};
+my $signature = $session{'CurrentUser'}->UserObj->Signature;

-if ($ARGS{'UpdateContent'} &&
-    $ARGS{'UpdateContent'} ne '' &&
-    $ARGS{'UpdateContent'} ne  "-- \n" .
-    $session{'CurrentUser'}->UserObj->Signature) {
+$content =~ s/\r|\n//g;
+$signature =~ s/\r|\n//g;
+if ($content &&
+    $content ne '' &&
+    $content ne  "-- " .
+    $signature) {

More information about the Rt-devel mailing list