[Rt-commit] r5858 - rt/branches/3.4-RELEASE/lib/RT
ruz at bestpractical.com
ruz at bestpractical.com
Mon Sep 4 18:09:32 EDT 2006
Author: ruz
Date: Mon Sep 4 18:09:30 2006
New Revision: 5858
Modified:
rt/branches/3.4-RELEASE/lib/RT/Transaction_Overlay.pm
Log:
::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/3.4-RELEASE/lib/RT/Transaction_Overlay.pm
==============================================================================
--- rt/branches/3.4-RELEASE/lib/RT/Transaction_Overlay.pm (original)
+++ rt/branches/3.4-RELEASE/lib/RT/Transaction_Overlay.pm Mon Sep 4 18:09:30 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