From 0bb3e1b26ea6cc8038241180b2f57b29a8590c71 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Sun, 14 Feb 2016 12:55:08 +0000 Subject: [PATCH] Bug 15548 [QA Followup] - More new uses of Koha::Borrower Signed-off-by: Kyle M Hall --- C4/Passwordrecovery.pm | 2 +- Koha/SMS/Provider.pm | 4 ++-- opac/opac-password-recovery.pl | 6 +++--- t/db_dependent/Passwordrecovery.t | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/C4/Passwordrecovery.pm b/C4/Passwordrecovery.pm index ea01e15..a67c4d4 100644 --- a/C4/Passwordrecovery.pm +++ b/C4/Passwordrecovery.pm @@ -103,7 +103,7 @@ sub GetValidLinkInfo { =cut sub SendPasswordRecoveryEmail { - my $borrower = shift; # Koha::Borrower + my $borrower = shift; # Koha::Patron my $userEmail = shift; #to_address (the one specified in the request) my $update = shift; diff --git a/Koha/SMS/Provider.pm b/Koha/SMS/Provider.pm index a9994d9..bbc9626 100644 --- a/Koha/SMS/Provider.pm +++ b/Koha/SMS/Provider.pm @@ -21,7 +21,7 @@ use Modern::Perl; use Carp; -use Koha::Borrowers; +use Koha::Patrons; use base qw(Koha::Object); @@ -47,7 +47,7 @@ Gives the number of patrons using this provider sub patrons_using { my ( $self ) = @_; - return Koha::Borrowers->search( { sms_provider_id => $self->id } )->count(); + return Koha::Patrons->search( { sms_provider_id => $self->id } )->count(); } =head3 _type diff --git a/opac/opac-password-recovery.pl b/opac/opac-password-recovery.pl index 7e3eae2..aa98040 100755 --- a/opac/opac-password-recovery.pl +++ b/opac/opac-password-recovery.pl @@ -11,7 +11,7 @@ use C4::Context; use C4::Passwordrecovery qw(SendPasswordRecoveryEmail ValidateBorrowernumber GetValidLinkInfo CompletePasswordRecovery); use Koha::AuthUtils qw(hash_password); -use Koha::Borrowers; +use Koha::Patrons; my $query = new CGI; use HTML::Entities; @@ -58,10 +58,10 @@ if ( $query->param('sendEmail') || $query->param('resendEmail') ) { # Find the borrower by his userid or email if ($username) { - $search_results = [ Koha::Borrowers->search( { userid => $username } ) ]; + $search_results = [ Koha::Patrons->search( { userid => $username } ) ]; } elsif ($email) { - $search_results = [ Koha::Borrowers->search( { -or => { email => $email, emailpro => $email, B_email => $email } } ) ]; + $search_results = [ Koha::Patrons->search( { -or => { email => $email, emailpro => $email, B_email => $email } } ) ]; } if ( not $search_results || scalar @$search_results > 1 ) { $hasError = 1; diff --git a/t/db_dependent/Passwordrecovery.t b/t/db_dependent/Passwordrecovery.t index e0ec8ec..a428033 100755 --- a/t/db_dependent/Passwordrecovery.t +++ b/t/db_dependent/Passwordrecovery.t @@ -20,7 +20,7 @@ use Modern::Perl; use C4::Context; use C4::Letters; use Koha::Database; -use Koha::Borrowers; +use Koha::Patrons; use Test::More tests => 16; @@ -134,7 +134,7 @@ ok( C4::Passwordrecovery::CompletePasswordRecovery($uuid2) == 0, "[CompletePassw # C4::Passwordrecovery::SendPasswordRecoveryEmail # ################################################### -my $borrower = shift [ Koha::Borrowers->search( { userid => $userid1 } ) ]; +my $borrower = shift [ Koha::Patrons->search( { userid => $userid1 } ) ]; ok( C4::Passwordrecovery::SendPasswordRecoveryEmail($borrower, $email1, 0) == 1, "[SendPasswordRecoveryEmail] Returns 1 on success" ); my $letters = C4::Letters::GetQueuedMessages( { borrowernumber => $borrowernumber1, limit => 99 } ); ok( scalar @$letters == 1, "[SendPasswordRecoveryEmail] There is a letter in the queue for our borrower"); -- 2.7.0