[Rt-commit] rt branch, 4.2/default-txn-description, created. rt-4.1.6-258-g0a45467

Thomas Sibley trs at bestpractical.com
Wed Feb 13 17:29:39 EST 2013


The branch, 4.2/default-txn-description has been created
        at  0a45467d6fbb8528caed44428b19aa3741691563 (commit)

- Log -----------------------------------------------------------------
commit 0a45467d6fbb8528caed44428b19aa3741691563
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Wed Feb 13 14:20:22 2013 -0800

    Evaluate the default transaction description only if necessary
    
    Otherwise, OldValue and NewValue are always called even if unneeded.
    This behaviour gets rid of the useless "(No description)" description
    added by 007eb26 and reverts the fallback behaviour to that pre-007eb26.

diff --git a/lib/RT/Transaction.pm b/lib/RT/Transaction.pm
index f90e9c9..1928d5a 100644
--- a/lib/RT/Transaction.pm
+++ b/lib/RT/Transaction.pm
@@ -640,21 +640,7 @@ sub BriefDescriptionAsHTML {
         return $self->loc("No transaction type specified");
     }
 
-    my ($template, @params) = (
-        "Default: [_1]/[_2] changed from [_3] to [_4]", #loc
-        $type,
-        $field,
-        (
-            $self->OldValue
-            ? "'" . $self->OldValue . "'"
-            : $self->loc("(no value)")
-        ),
-        (
-            $self->NewValue
-            ? "'" . $self->NewValue . "'"
-            : $self->loc("(no value)")
-        ),
-    );
+    my ($template, @params);
 
     my @code = grep { ref eq 'CODE' } map { $_BriefDescriptions{$_} }
         ( $field
@@ -667,7 +653,21 @@ sub BriefDescriptionAsHTML {
     }
 
     unless ($template) {
-        ($template, @params) = ("(No description)"); #loc
+        ($template, @params) = (
+            "Default: [_1]/[_2] changed from [_3] to [_4]", #loc
+            $type,
+            $field,
+            (
+                $self->OldValue
+                ? "'" . $self->OldValue . "'"
+                : $self->loc("(no value)")
+            ),
+            (
+                $self->NewValue
+                ? "'" . $self->NewValue . "'"
+                : $self->loc("(no value)")
+            ),
+        );
     }
     return $self->loc($template, $self->_ProcessReturnValues(@params));
 }

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


More information about the Rt-commit mailing list