[Rt-commit] rt branch, 4.0/apply-scrips-to-multiple-queues, updated. rt-4.0.4-230-g1c9bbd1

Thomas Sibley trs at bestpractical.com
Tue Oct 16 15:18:14 EDT 2012


The branch, 4.0/apply-scrips-to-multiple-queues has been updated
       via  1c9bbd14eee270f32f341301aa429d7890c329ae (commit)
      from  fa9736816c873db13408aeaa4719a18c0b049853 (commit)

Summary of changes:
 lib/RT/ObjectCustomField.pm | 3 ++-
 lib/RT/ObjectScrip.pm       | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit 1c9bbd14eee270f32f341301aa429d7890c329ae
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue Oct 16 12:03:50 2012 -0700

    Let defaults in RT::Record::AddAndSort->Create take effect
    
    Avoids "autovivifying" explicit undef values for columns which were
    omitted in the original call to Create.  Now the default of
    
        ObjectId => 0
    
    in SUPER::Create is actually used.
    
    The dropping of the default ObjectId meant non-queue/ticket custom
    fields created from an initialdata failed to be applied globally (the
    intended behaviour).

diff --git a/lib/RT/ObjectCustomField.pm b/lib/RT/ObjectCustomField.pm
index e06a153..0b5068a 100644
--- a/lib/RT/ObjectCustomField.pm
+++ b/lib/RT/ObjectCustomField.pm
@@ -68,7 +68,8 @@ sub Create {
     my $self = shift;
     my %args = (@_);
     return $self->SUPER::Create(
-        map { $_ => $args{ $_ } } qw(
+         map { $_ => $args{ $_ } }
+        grep { exists $args{$_} } qw(
             CustomField ObjectId
             SortOrder Disabled
             Created Creator
diff --git a/lib/RT/ObjectScrip.pm b/lib/RT/ObjectScrip.pm
index 2735656..e0a2581 100644
--- a/lib/RT/ObjectScrip.pm
+++ b/lib/RT/ObjectScrip.pm
@@ -80,7 +80,8 @@ sub Create {
     my %args = (@_);
     $args{'Stage'} ||= 'TransactionCreate'; #XXX: why don't we turn undef into default?
     return $self->SUPER::Create(
-        map { $_ => $args{ $_ } } qw(
+         map { $_ => $args{ $_ } }
+        grep { exists $args{$_} } qw(
             Scrip Stage ObjectId
             SortOrder Disabled
             Created Creator

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


More information about the Rt-commit mailing list