Bugzilla – Attachment 101230 Details for
Bug 20443
Move C4::Members::Attributes to Koha namespace
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20443: Fix Patrons/Import.t
Bug-20443-Fix-PatronsImportt.patch (text/plain), 2.15 KB, created by
Jonathan Druart
on 2020-03-20 15:06:20 UTC
(
hide
)
Description:
Bug 20443: Fix Patrons/Import.t
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-03-20 15:06:20 UTC
Size:
2.15 KB
patch
obsolete
>From 06f640241a4c9e3c9c9b7cdaa774819573347023 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 27 Nov 2019 15:49:36 +0100 >Subject: [PATCH] Bug 20443: Fix Patrons/Import.t > >->get_patrons has been removed but not replaced! > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > Koha/Patrons/Import.pm | 10 ++++++++-- > t/db_dependent/Koha/Patrons/Import.t | 1 - > 2 files changed, 8 insertions(+), 3 deletions(-) > >diff --git a/Koha/Patrons/Import.pm b/Koha/Patrons/Import.pm >index 78938d699f..6bd13edbb2 100644 >--- a/Koha/Patrons/Import.pm >+++ b/Koha/Patrons/Import.pm >@@ -174,8 +174,14 @@ sub import_patrons { > elsif ($extended) { > if ( defined($matchpoint_attr_type) ) { > foreach my $attr (@$patron_attributes) { >- if ( $attr->{code} eq $matchpoint and $attr->{value} ne '' ) { >- my @borrowernumbers = $matchpoint_attr_type->get_patrons( $attr->{value} ); >+ if ( $attr->{code} eq $matchpoint and $attr->{attribute} ne '' ) { >+ my @borrowernumbers = Koha::Patron::Attributes->search( >+ { >+ code => $matchpoint_attr_type->code, >+ attribute => $attr->{attribute} >+ } >+ )->get_column('borrowernumber'); >+ > $borrowernumber = $borrowernumbers[0] if scalar(@borrowernumbers) == 1; > $patron = Koha::Patrons->find( $borrowernumber ); > last; >diff --git a/t/db_dependent/Koha/Patrons/Import.t b/t/db_dependent/Koha/Patrons/Import.t >index d879aad278..fade0929a1 100644 >--- a/t/db_dependent/Koha/Patrons/Import.t >+++ b/t/db_dependent/Koha/Patrons/Import.t >@@ -214,7 +214,6 @@ my $params_4 = { file => $handle_4, matchpoint => $attribute->{code}, }; > > # When ... > my $result_4 = $patrons_import->import_patrons($params_4); >-use Data::Printer colored => 1; warn p $result_4; > > # Then ... > is($result_4->{already_in_db}, 0, 'Got the expected 0 already_in_db from import_patrons with extended user'); >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20443
:
101122
|
101123
|
101124
|
101125
|
101126
|
101127
|
101128
|
101129
|
101130
|
101131
|
101132
|
101133
|
101134
|
101135
|
101136
|
101137
|
101138
|
101139
|
101140
|
101141
|
101142
|
101143
|
101144
|
101145
|
101146
|
101147
|
101148
|
101149
|
101150
|
101209
|
101210
|
101211
|
101212
|
101213
|
101214
|
101215
|
101216
|
101217
|
101218
|
101219
|
101220
|
101221
|
101222
|
101223
|
101224
|
101225
|
101226
|
101227
|
101228
|
101229
| 101230 |
101231
|
101232
|
101233
|
101234
|
101235
|
101236
|
101237
|
101472
|
104519