[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.8.8-567-gc2d8751
Shawn Moore
sartak at bestpractical.com
Wed Aug 25 19:38:59 EDT 2010
The branch, 3.9-trunk has been updated
via c2d87516b5d947ff3aaa74bd50547501b555ccef (commit)
from 9023b7dab2cca8133c182f2e3689b7f558c907a7 (commit)
Summary of changes:
lib/RT/Transaction_Overlay.pm | 14 ++++++++------
1 files changed, 8 insertions(+), 6 deletions(-)
- Log -----------------------------------------------------------------
commit c2d87516b5d947ff3aaa74bd50547501b555ccef
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Wed Aug 25 19:40:46 2010 -0400
Store the new/old values of a CF to avoid calling the methods repeatedly
diff --git a/lib/RT/Transaction_Overlay.pm b/lib/RT/Transaction_Overlay.pm
index 4113c79..dfc21b5 100755
--- a/lib/RT/Transaction_Overlay.pm
+++ b/lib/RT/Transaction_Overlay.pm
@@ -730,15 +730,17 @@ sub BriefDescription {
$field = $cf->Name();
}
- if ( ! defined $self->OldValue || $self->OldValue eq '' ) {
- return ( $self->loc("[_1] [_2] added", $field, $self->NewValue) );
- }
- elsif ( !defined $self->NewValue || $self->NewValue eq '' ) {
- return ( $self->loc("[_1] [_2] deleted", $field, $self->OldValue) );
+ my $new = $self->NewValue;
+ my $old = $self->OldValue;
+ if ( !defined($old) || $old eq '' ) {
+ return $self->loc("[_1] [_2] added", $field, $new);
+ }
+ elsif ( !defined($new) || $new eq '' ) {
+ return $self->loc("[_1] [_2] deleted", $field, $old);
}
else {
- return $self->loc("[_1] [_2] changed to [_3]", $field, $self->OldValue, $self->NewValue );
+ return $self->loc("[_1] [_2] changed to [_3]", $field, $old, $new);
}
},
Untake => sub {
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list