[Bps-public-commit] RT-Extension-rt_cpan_org branch, rt4, updated. be7b28625897e72b0a8f6a4b754395b01bbbedf1

Thomas Sibley trs at bestpractical.com
Fri Mar 1 20:54:11 EST 2013


The branch, rt4 has been updated
       via  be7b28625897e72b0a8f6a4b754395b01bbbedf1 (commit)
      from  b3186043095daf99d4546f28ea4d097c0d3c5012 (commit)

Summary of changes:
 patches/4.0.10-plain-text-attachments.patch | 75 +++++++++++++++++++++++++++++
 1 file changed, 75 insertions(+)
 create mode 100644 patches/4.0.10-plain-text-attachments.patch

- Log -----------------------------------------------------------------
commit be7b28625897e72b0a8f6a4b754395b01bbbedf1
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Fri Mar 1 17:53:50 2013 -0800

    Add a patch to correct plain text attachment display

diff --git a/patches/4.0.10-plain-text-attachments.patch b/patches/4.0.10-plain-text-attachments.patch
new file mode 100644
index 0000000..6d4cc98
--- /dev/null
+++ b/patches/4.0.10-plain-text-attachments.patch
@@ -0,0 +1,75 @@
+From 86f7b03372df6f30fb8e9aad043b9b4721dc4eb8 Mon Sep 17 00:00:00 2001
+From: Thomas Sibley <trs at bestpractical.com>
+Date: Fri, 1 Mar 2013 17:45:30 -0800
+Subject: [PATCH] Respect plain text display preferences for all plain text
+ content
+
+Attachments with filenames are never parsed with Text::Quoted, so the
+passed in $Message content was never an array reference.  This caused
+textual attachments to ignore the PlainTextPre and PlainTextMono
+settings, the symptom of which is nigh unreadable text.  Moving those
+preferences out of the conditional corrects the display.  Now every call
+to ShowMessageStanza with a text/plain content type will result in a
+<div class="message-stanza">, which may be white-space preserving and/or
+wrapped in a <pre>.
+---
+ share/html/Ticket/Elements/ShowMessageStanza | 32 ++++++++++++++--------------
+ 1 file changed, 16 insertions(+), 16 deletions(-)
+
+diff --git a/share/html/Ticket/Elements/ShowMessageStanza b/share/html/Ticket/Elements/ShowMessageStanza
+index beca35c..716bdfb 100644
+--- a/share/html/Ticket/Elements/ShowMessageStanza
++++ b/share/html/Ticket/Elements/ShowMessageStanza
+@@ -77,16 +77,16 @@ my $print_content = sub {
+     $m->out($$ref);
+ };
+ 
+-if ( ref $Message ) {
+-    $m->out('<pre>')
+-        if (    $ContentType eq 'text/plain'
+-             && $plain_text_pre
+-             && !$Depth
+-             && !$plain_text_mono );
+-    $m->out(   '<div class="message-stanza'
+-             . ( ($ContentType eq 'text/plain' &&  $plain_text_mono) ? ' plain-text-white-space' : '' ) . '"'
+-             . '>' );
++$m->out('<pre>')
++    if (    $ContentType eq 'text/plain'
++         && $plain_text_pre
++         && !$Depth
++         && !$plain_text_mono );
++$m->out(   '<div class="message-stanza'
++         . ( ($ContentType eq 'text/plain' &&  $plain_text_mono) ? ' plain-text-white-space' : '' ) . '"'
++         . '>' );
+ 
++if ( ref $Message ) {
+     my @stack;
+     my $para = '';
+     my $i    = 0;
+@@ -170,16 +170,16 @@ AGAIN: foreach ( ; $i < @$Message; $i++ ) {
+         $m->out('</div>');
+         goto AGAIN;
+     }
+-
+-    $m->out('</div>');
+-    $m->out('</pre>')
+-        if (    $ContentType eq 'text/plain'
+-             && $plain_text_pre
+-             && !$Depth
+-             && !$plain_text_mono );
+ } else {
+     $print_content->( \$Message );
+ }
++
++$m->out('</div>');
++$m->out('</pre>')
++    if (    $ContentType eq 'text/plain'
++         && $plain_text_pre
++         && !$Depth
++         && !$plain_text_mono );
+ </%INIT>
+ <%ARGS>
+ $Message => undef
+-- 
+1.7.11.3
+

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list