[Rt-commit] rt branch, 4.2/allow-set-undef, created. rt-4.0.0rc7-255-gf597f8c

? sunnavy sunnavy at bestpractical.com
Thu May 26 02:05:14 EDT 2011


The branch, 4.2/allow-set-undef has been created
        at  f597f8c4ab8ffe8419ecfcd7803f357d040bd6fa (commit)

- Log -----------------------------------------------------------------
commit cfa979d1f94c762a9e5731c4018f3e5deccfb7d5
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu May 26 12:27:51 2011 +0800

    no need to cast: we should make SB support undef set

diff --git a/lib/RT/Record.pm b/lib/RT/Record.pm
index bd3e6b5..6895ad3 100644
--- a/lib/RT/Record.pm
+++ b/lib/RT/Record.pm
@@ -470,13 +470,6 @@ sub _Set {
         @_
     );
 
-    #if the user is trying to modify the record
-    # TODO: document _why_ this code is here
-
-    if ( ( !defined( $args{'Field'} ) ) || ( !defined( $args{'Value'} ) ) ) {
-        $args{'Value'} = 0;
-    }
-
     my $old_val = $self->__Value($args{'Field'});
      $self->_SetLastUpdated();
     my $ret = $self->SUPER::_Set(

commit 0e9b9d0c02ba76f6509bb39463f415db9fea8acb
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu May 26 12:44:52 2011 +0800

    new_value maybe undef

diff --git a/lib/RT/Record.pm b/lib/RT/Record.pm
index 6895ad3..7f86838 100644
--- a/lib/RT/Record.pm
+++ b/lib/RT/Record.pm
@@ -484,12 +484,13 @@ sub _Set {
     # $ret is a Class::ReturnValue object. as such, in a boolean context, it's a bool
     # we want to change the standard "success" message
     if ($status) {
+        my $new_val = $self->__Value($args{'Field'});
         $msg =
           $self->loc(
             "[_1] changed from [_2] to [_3]",
             $self->loc( $args{'Field'} ),
             ( $old_val ? "'$old_val'" : $self->loc("(no value)") ),
-            '"' . $self->__Value( $args{'Field'}) . '"' 
+            ( $new_val ? "'$new_val'" : $self->loc("(no value)") ),
           );
       } else {
 

commit f597f8c4ab8ffe8419ecfcd7803f357d040bd6fa
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu May 26 12:45:08 2011 +0800

    SubjectTab maybe already undef

diff --git a/t/mail/charsets-outgoing.t b/t/mail/charsets-outgoing.t
index 2fc91f2..e63e622 100644
--- a/t/mail/charsets-outgoing.t
+++ b/t/mail/charsets-outgoing.t
@@ -25,10 +25,7 @@ my $queue = RT::Test->load_or_create_queue(
 ok $queue && $queue->id, 'loaded or created queue';
 
 diag "make sure queue has no subject tag";
-{
-    my ($status, $msg) = $queue->SetSubjectTag( undef );
-    ok $status, "set subject tag for the queue" or diag "error: $msg";
-}
+is( $queue->SubjectTag, undef, "queue has no subject tag" );
 
 diag "set intial simple autoreply template";
 {

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


More information about the Rt-commit mailing list