[Rt-commit] r4957 - in rt/branches/3.7-EXPERIMENTAL: .
ruz at bestpractical.com
ruz at bestpractical.com
Tue Apr 4 13:53:00 EDT 2006
Author: ruz
Date: Tue Apr 4 13:52:56 2006
New Revision: 4957
Modified:
rt/branches/3.7-EXPERIMENTAL/ (props changed)
rt/branches/3.7-EXPERIMENTAL/lib/RT/Record.pm
Log:
r2298 at cubic-pc: cubic | 2006-04-04 17:18:58 +0400
* $old_value is object not a string, use $old_content instead
* reuse varables
* drop uninit warnings
Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Record.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Record.pm (original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Record.pm Tue Apr 4 13:52:56 2006
@@ -1674,15 +1674,16 @@
);
}
- if ( $old_value eq '' ) {
- return ( 1, $self->loc( "[_1] [_2] added", $cf->Name, $new_value->Content ));
+ my $new_content = $new_value->Content;
+ if ( $old_value && ( !defined $old_content || $old_content eq '' ) ) {
+ return ( 1, $self->loc( "[_1] [_2] added", $cf->Name, $new_content ));
}
- elsif ( $new_value->Content eq '' ) {
+ elsif ( !defined $new_content || $new_content eq '' ) {
return ( 1,
- $self->loc( "[_1] [_2] deleted", $cf->Name, $old_value->Content ) );
+ $self->loc( "[_1] [_2] deleted", $cf->Name, $old_content ) );
}
else {
- return ( 1, $self->loc( "[_1] [_2] changed to [_3]", $cf->Name, $old_content, $new_value->Content));
+ return ( 1, $self->loc( "[_1] [_2] changed to [_3]", $cf->Name, $old_content, $new_content));
}
}
More information about the Rt-commit
mailing list