[Rt-commit] rt branch, 4.0/cfs-on-create-regression, created. rt-4.0.13-41-g415a98c

Thomas Sibley trs at bestpractical.com
Thu May 23 14:58:09 EDT 2013


The branch, 4.0/cfs-on-create-regression has been created
        at  415a98c1af6240ad1c2ecfca37cbb40a9eff64f4 (commit)

- Log -----------------------------------------------------------------
commit 415a98c1af6240ad1c2ecfca37cbb40a9eff64f4
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Thu May 23 11:47:01 2013 -0700

    Revert "no need to load object with id of value 0"
    
    ProcessObjectCustomFieldUpdates() is sometimes passed a loaded Object
    which may used when the given id is zero.  For example, this is the
    usage seen at user creation in Admin/Users/Modify.html.  The new user
    object is first created and then passed to our function, but the CF
    query args come from the previous page from before the id was known.
    Since ->Load(0) _will_ be called on the already loaded Object, the
    record class must explicitly subclass Load to make it a no-op when the
    identifier is false.  While this is quirky, the need for such a use case
    is solid, and more than just user creation takes advantage of it.  It is
    essentially the poor man's version of Jifty::Request::Mapper.
    
    Additional CF tests on master which aren't on 4.0-trunk revealed the
    regression.
    
    This reverts commit 163a5ed58573e4e5da421342f66fdbabb1ec2506.

diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index 7d9aa21..dcf89fa 100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -2677,7 +2677,6 @@ sub ProcessObjectCustomFieldUpdates {
     # For each of those objects
     foreach my $class ( keys %custom_fields_to_mod ) {
         foreach my $id ( keys %{ $custom_fields_to_mod{$class} } ) {
-            next unless $id;
             my $Object = $args{'Object'};
             $Object = $class->new( $session{'CurrentUser'} )
                 unless $Object && ref $Object eq $class;

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


More information about the Rt-commit mailing list