View | Details | Raw Unified | Return to bug 20443
Collapse All | Expand All

(-)a/Koha/Patrons/Import.pm (-2 / +8 lines)
Lines 174-181 sub import_patrons { Link Here
174
        elsif ($extended) {
174
        elsif ($extended) {
175
            if ( defined($matchpoint_attr_type) ) {
175
            if ( defined($matchpoint_attr_type) ) {
176
                foreach my $attr (@$patron_attributes) {
176
                foreach my $attr (@$patron_attributes) {
177
                    if ( $attr->{code} eq $matchpoint and $attr->{value} ne '' ) {
177
                    if ( $attr->{code} eq $matchpoint and $attr->{attribute} ne '' ) {
178
                        my @borrowernumbers = $matchpoint_attr_type->get_patrons( $attr->{value} );
178
                        my @borrowernumbers = Koha::Patron::Attributes->search(
179
                            {
180
                                code      => $matchpoint_attr_type->code,
181
                                attribute => $attr->{attribute}
182
                            }
183
                        )->get_column('borrowernumber');
184
179
                        $borrowernumber = $borrowernumbers[0] if scalar(@borrowernumbers) == 1;
185
                        $borrowernumber = $borrowernumbers[0] if scalar(@borrowernumbers) == 1;
180
                        $patron = Koha::Patrons->find( $borrowernumber );
186
                        $patron = Koha::Patrons->find( $borrowernumber );
181
                        last;
187
                        last;
(-)a/t/db_dependent/Koha/Patrons/Import.t (-2 lines)
Lines 214-220 my $params_4 = { file => $handle_4, matchpoint => $attribute->{code}, }; Link Here
214
214
215
# When ...
215
# When ...
216
my $result_4 = $patrons_import->import_patrons($params_4);
216
my $result_4 = $patrons_import->import_patrons($params_4);
217
use Data::Printer colored => 1; warn p $result_4;
218
217
219
# Then ...
218
# Then ...
220
is($result_4->{already_in_db}, 0, 'Got the expected 0 already_in_db from import_patrons with extended user');
219
is($result_4->{already_in_db}, 0, 'Got the expected 0 already_in_db from import_patrons with extended user');
221
- 

Return to bug 20443