[Rt-commit] rt branch, 4.0/rest-reedit-content, created. rt-4.0.10-132-g8bca9b4

? sunnavy sunnavy at bestpractical.com
Mon Mar 25 09:20:33 EDT 2013


The branch, 4.0/rest-reedit-content has been created
        at  8bca9b4b4fac320b89073b08fd6f921d1dcb1c42 (commit)

- Log -----------------------------------------------------------------
commit 8bca9b4b4fac320b89073b08fd6f921d1dcb1c42
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Mar 25 21:08:40 2013 +0800

    show original text in editor when reediting
    
    before we only show the error messages returned from server, which is bad for
    user to correct.
    
    I also tweaked error messages a bit so it won't affect the upcoming
    submission, e.g. error messages from server could be:
    
        # Could not create ticket.
        # Foo: Unknown field
    
        Foo: bar
    
    after tweaking, it becomes:
    
        # Could not create ticket.
        # Foo: Unknown field
        #
        #     Foo: bar
    
    see also #22287

diff --git a/bin/rt.in b/bin/rt.in
index 64975ad..14bec11 100644
--- a/bin/rt.in
+++ b/bin/rt.in
@@ -671,7 +671,9 @@ EDIT:
             # If we submitted a bad form, we'll give the user a chance
             # to correct it and resubmit.
             if ($edit || (!$input && !$cl)) {
-                $text = $r->content;
+                my $content = $r->content;
+                $content =~ s/^(?!#)/#     /mg;
+                $text = $content . $text;
                 $synerr = 1;
                 goto EDIT;
             }

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


More information about the Rt-commit mailing list