From 41a19f420d94427d6d69235732021e6f9ba78611 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 8 Aug 2016 14:12:09 +0100 Subject: [PATCH] Bug 17080: Make C4::Members::AddMember uses Koha::Patron->store MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit These calls have been added from commit e196f19 (Bug 12633: Remove SQLHelper in C4::Members) which added a TODO: "This patch replaced the calls to SQLHelper to use DBIX::Class. TODO: Move them to Koha::Borrower." This is now done by this patch: instead of calling DBIx::Class directly we use Koha::Patron Signed-off-by: Marc Véron Signed-off-by: Nick Clemens Signed-off-by: Kyle M Hall --- C4/Members.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index 702e36d7f4..9accdcd314 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -635,8 +635,8 @@ sub AddMember { $new_member->{checkprevcheckout} ||= 'inherit'; delete $new_member->{borrowernumber}; - my $rs = $schema->resultset('Borrower'); - $data{borrowernumber} = $rs->create($new_member)->id; + my $patron = Koha::Patron->new( $new_member )->store; + $data{borrowernumber} = $patron->borrowernumber; # If NorwegianPatronDBEnable is enabled, we set syncstatus to something that a # cronjob will use for syncing with NL -- 2.39.5