[Rt-commit] rt branch, 4.0/check-record-note-results-in-correspond, created. rt-4.0.8-350-g59fea8d

? sunnavy sunnavy at bestpractical.com
Sun Jan 13 12:25:07 EST 2013


The branch, 4.0/check-record-note-results-in-correspond has been created
        at  59fea8dc0624349c6feb64d9df2f07836ca1d1eb (commit)

- Log -----------------------------------------------------------------
commit 59fea8dc0624349c6feb64d9df2f07836ca1d1eb
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Jan 14 01:03:35 2013 +0800

    check/shortcircuit _RecordNote's results in case it fails
    
    because the following _SetTold depends on the success of _RecordNote.
    see also #20489 for an example to trigger this(not a good one though)

diff --git a/lib/RT/Ticket.pm b/lib/RT/Ticket.pm
index 47e61e9..c344b5c 100644
--- a/lib/RT/Ticket.pm
+++ b/lib/RT/Ticket.pm
@@ -2180,6 +2180,11 @@ sub Correspond {
 
     my @results = $self->_RecordNote(%args);
 
+    unless ( $results[0] ) {
+        $RT::Handle->Rollback();
+        return @results;
+    }
+
     #Set the last told date to now if this isn't mail from the requestor.
     #TODO: Note that this will wrongly ack mail from any non-requestor as a "told"
     unless ( $self->IsRequestor($self->CurrentUser->id) ) {

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


More information about the Rt-commit mailing list