From 65c04acc7c47b5b37e783d85a2fe590fe8ff3c63 Mon Sep 17 00:00:00 2001 From: Martin Kamerbeek Date: Fri, 9 Jul 2010 10:30:59 +0200 Subject: [PATCH] Fix bug where default propeties were not applied correctly to mailings generated by managers. --- lib/WebGUI/Mailing.pm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/WebGUI/Mailing.pm b/lib/WebGUI/Mailing.pm index 2e8d604..1591e9c 100644 --- a/lib/WebGUI/Mailing.pm +++ b/lib/WebGUI/Mailing.pm @@ -590,15 +590,15 @@ sub www_editSave { my %fields = %{ $self->getAsset->getMailingProperties( $self ) }; my $configuration = {}; - if ( $self->admin->canOverride ) { - while ( my( $name, $properties ) = each %fields ) { - my $value = $form->process( $name, $properties->{ fieldType }, $properties->{ defaultValue } ); + while ( my( $name, $properties ) = each %fields ) { + if ( $self->admin->canOverride ) { + my $value = $form->process( $name, $properties->{ fieldType }, $properties->{ defaultValue } ); - $configuration->{ $name } = $value; - } - } - else { - $configuration = \%fields; + $configuration->{ $name } = $value; + } + else { + $configuration->{ $name } = $properties->{ defaultValue } || $properties->{ value }; + } } #### TODO: Add error checking and required fields?