diff --git a/docs/upgrades/upgrade_7.10.21-7.10.22.pl b/docs/upgrades/upgrade_7.10.21-7.10.22.pl index 41f41d697..3699cd990 100644 --- a/docs/upgrades/upgrade_7.10.21-7.10.22.pl +++ b/docs/upgrades/upgrade_7.10.21-7.10.22.pl @@ -63,12 +63,14 @@ sub addLinkedProfileAddress { my $session = shift; print "\tAdding linked profile addresses for existing users... " unless $quiet; - my $users = $session->db->buildArrayRef( q{ - select userId from users where userId not in ('1','3') - } ); + my $users = $session->db->read( q{ select userId from users } ); - foreach my $userId (@$users) { + use WebGUI::User; + use WebGUI::Shop::AddressBook; + while (my ($userId) = $users->array()) { #check to see if there is user profile information available + next if $userId eq '1' or $userId eq '3'; + last unless $userId; my $u = WebGUI::User->new($session,$userId); #skip if user does not have any homeAddress fields filled in next unless ( diff --git a/docs/upgrades/upgrade_7.9.34-7.10.22.pl b/docs/upgrades/upgrade_7.9.34-7.10.22.pl index 33cb8dea8..4ede1410c 100644 --- a/docs/upgrades/upgrade_7.9.34-7.10.22.pl +++ b/docs/upgrades/upgrade_7.9.34-7.10.22.pl @@ -433,14 +433,15 @@ sub addLinkedProfileAddress { my $session = shift; print "\tAdding linked profile addresses for existing users... " unless $quiet; - my $users = $session->db->buildArrayRef( q{ - select userId from users where userId not in ('1','3') - } ); + my $users = $session->db->read( q{ select userId from users } ); use WebGUI::User; use WebGUI::Shop::AddressBook; - foreach my $userId (@$users) { + + while (my ($userId) = $users->array()) { #check to see if there is user profile information available + next if $userId eq '1' or $userId eq '3'; + last unless $userId; my $u = WebGUI::User->new($session,$userId); #skip if user does not have any homeAddress fields filled in next unless (