[Rt-commit] r6051 - in rt/branches/QUEBEC-EXPERIMENTAL: .
ruz at bestpractical.com
ruz at bestpractical.com
Tue Sep 26 20:15:30 EDT 2006
Author: ruz
Date: Tue Sep 26 20:15:29 2006
New Revision: 6051
Modified:
rt/branches/QUEBEC-EXPERIMENTAL/ (props changed)
rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Transaction_Overlay.pm
Log:
r3698 at cubic-pc (orig r5858): ruz | 2006-09-05 02:09:30 +0400
::OldValue and ::NewValue
* don't load object if {Old,New}Reference is false value
** this is hitting some cache issues and could return "random" result
which brakes tickets' history.
Thanks to Joshua Speicher.
Modified: rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Transaction_Overlay.pm
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Transaction_Overlay.pm (original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/Transaction_Overlay.pm Tue Sep 26 20:15:29 2006
@@ -940,25 +940,29 @@
sub OldValue {
my $self = shift;
- if (my $type = $self->__Value('ReferenceType')) {
- my $Object = $type->new($self->CurrentUser);
- $Object->Load($self->__Value('OldReference'));
- return $Object->Content;
+ if ( my $type = $self->__Value('ReferenceType')
+ and my $id = $self->__Value('OldReference') )
+ {
+ my $Object = $type->new($self->CurrentUser);
+ $Object->Load( $id );
+ return $Object->Content;
}
else {
- return $self->__Value('OldValue');
+ return $self->__Value('OldValue');
}
}
sub NewValue {
my $self = shift;
- if (my $type = $self->__Value('ReferenceType')) {
- my $Object = $type->new($self->CurrentUser);
- $Object->Load($self->__Value('NewReference'));
- return $Object->Content;
+ if ( my $type = $self->__Value('ReferenceType')
+ and my $id = $self->__Value('NewReference') )
+ {
+ my $Object = $type->new($self->CurrentUser);
+ $Object->Load( $id );
+ return $Object->Content;
}
else {
- return $self->__Value('NewValue');
+ return $self->__Value('NewValue');
}
}
More information about the Rt-commit
mailing list