diff --git a/lib/WebGUI/Account.pm b/lib/WebGUI/Account.pm index ca3b4ce62..e6f6ec584 100644 --- a/lib/WebGUI/Account.pm +++ b/lib/WebGUI/Account.pm @@ -21,7 +21,7 @@ has method => ( has uid => ( is => 'rw', - default => 'view', + default => '', ); has bare => ( diff --git a/lib/WebGUI/Account/Profile.pm b/lib/WebGUI/Account/Profile.pm index 1d58ca007..5690337ad 100644 --- a/lib/WebGUI/Account/Profile.pm +++ b/lib/WebGUI/Account/Profile.pm @@ -7,6 +7,7 @@ use WebGUI::International; use WebGUI::Pluggable; use WebGUI::ProfileCategory; use WebGUI::ProfileField; +use WebGUI::Shop::AddressBook; use base qw/WebGUI::Account/; =head1 NAME @@ -462,9 +463,7 @@ sub www_editSave { if($e = WebGUI::Error->caught('WebGUI::Error::ObjectNotFound')) { #Get home address only mappings to avoid creating addresses with just firstName, lastName, email my %home_address_map = %{$address_mappings}; - foreach my $exclude ( qw{ firstName lastName email } ) { - delete $home_address_map{$exclude}; - } + delete $home_address_map{qw/firstName lastName email/}; #Add the profile address for the user if there are homeAddress fields if( grep { $address->{$_} } values %home_address_map ) { $address->{label} = "Profile Address"; diff --git a/t/Account/Profile.t b/t/Account/Profile.t index 8b56538d1..23b2b5bce 100644 --- a/t/Account/Profile.t +++ b/t/Account/Profile.t @@ -173,7 +173,7 @@ $andy = $session->user; #Test that the address was saved to the profile cmp_bag ( - [ map { $andy->profileField($_) } keys %profile_info ], + [ map { $andy->get($_) } keys %profile_info ], [ values %profile_info ], 'Profile fields were updated' );