Bugzilla – Attachment 120614 Details for
Bug 28220
Exception not caught when importing patrons
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28220: UI changes
Bug-28220-UI-changes.patch (text/plain), 5.76 KB, created by
Jonathan Druart
on 2021-05-06 10:49:25 UTC
(
hide
)
Description:
Bug 28220: UI changes
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-05-06 10:49:25 UTC
Size:
5.76 KB
patch
obsolete
>From d4afc0408950edfe684273ec75dd5e582f7725bc Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 6 May 2021 12:38:52 +0200 >Subject: [PATCH] Bug 28220: UI changes > >--- > Koha/Patrons/Import.pm | 6 ++--- > .../prog/en/modules/tools/import_borrowers.tt | 27 +++++++++++++++++++ > t/db_dependent/Koha/Patrons/Import.t | 6 ++--- > 3 files changed, 33 insertions(+), 6 deletions(-) > >diff --git a/Koha/Patrons/Import.pm b/Koha/Patrons/Import.pm >index 14a47ae8796..e6c59eab487 100644 >--- a/Koha/Patrons/Import.pm >+++ b/Koha/Patrons/Import.pm >@@ -343,11 +343,11 @@ sub import_patrons { > > my $patron_id = defined $matchpoint ? $borrower{$matchpoint} : $matchpoint_attr_type; > if ( $_->isa('Koha::Exceptions::Patron::Attribute::UniqueIDConstraint') ) { >- push @errors, { patron_attribute_unique_id_constraint => 1, patron_id => $patron_id, attribute => $_->attribute }; >+ push @errors, { patron_attribute_unique_id_constraint => 1, borrowernumber => $borrowernumber, attribute => $_->attribute }; > } elsif ( $_->isa('Koha::Exceptions::Patron::Attribute::InvalidType') ) { >- push @errors, { patron_attribute_invalid_type => 1, patron_id => $patron_id, attribute_type_code => $_->type }; >+ push @errors, { patron_attribute_invalid_type => 1, borrowernumber => $borrowernumber, attribute_type_code => $_->type }; > } elsif ( $_->isa('Koha::Exceptions::Patron::Attribute::NonRepeatable') ) { >- push @errors, { patron_attribute_non_repeatable => 1, patron_id => $patron_id, attribute => $_->attribute }; >+ push @errors, { patron_attribute_non_repeatable => 1, borrowernumber => $borrowernumber, attribute => $_->attribute }; > } else { > use Data::Printer colored => 1; warn p $_; > push @errors, { unknown_error => 1 }; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt >index d4445c1afad..4237c8fcc9d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/import_borrowers.tt >@@ -169,6 +169,33 @@ > Password error for patron with borrowernumber [% e.borrowernumber | html %]. > </li> > [% END %] >+ [% IF e.patron_attribute_unique_id_constraint %] >+ <li class="line_error"> >+ [% IF e.borrowernumber %] >+ Patron attribute [% e.attribute.code | html %] must be unique for patron with borrowernumber [% e.borrowernumber | html %]. >+ [% ELSE %] >+ Patron attribute [% e.attribute.code | html %] must be unique for patron [% e.patron_id | html %]. >+ [% END %] >+ </li> >+ [% END %] >+ [% IF e.patron_attribute_invalid_type %] >+ <li class="line_error"> >+ [% IF e.borrowernumber %] >+ Patron attribute [% e.attribute_type_code | html %] is invalid for patron with borrowernumber [% e.borrowernumber | html %]. >+ [% ELSE %] >+ Patron attribute [% e.attribute_type_code | html %] is invalid for patron [% e.patron_id | html %]. >+ [% END %] >+ </li> >+ [% END %] >+ [% IF e.patron_attribute_non_repeatable %] >+ <li class="line_error"> >+ [% IF e.borrowernumber %] >+ Patron attribute [% e.attribute.code | html %] is non-repeatable for patron with borrowernumber [% e.borrowernumber | html %]. >+ [% ELSE %] >+ Patron attribute [% e.attribute.code | html %] is non-repeatable for patron [% e.patron_id | html %]. >+ [% END %] >+ </li> >+ [% END %] > [% END %] > </ul> > </div> >diff --git a/t/db_dependent/Koha/Patrons/Import.t b/t/db_dependent/Koha/Patrons/Import.t >index b3ba72ee9d8..4cdcb3b7418 100755 >--- a/t/db_dependent/Koha/Patrons/Import.t >+++ b/t/db_dependent/Koha/Patrons/Import.t >@@ -1042,7 +1042,7 @@ subtest 'patron_attributes' => sub { > is( $result->{overwritten}, 0 ); > my $error = $result->{errors}->[0]; > is( $error->{patron_attribute_unique_id_constraint}, 1 ); >- is( $error->{patron_id}, $cardnumber ); >+ is( $error->{borrowernumber}, $patron->borrowernumber ); > is( $error->{attribute}->code, $unique_attribute_type->code ); > > compare_patron_attributes($patron->extended_attributes->unblessed, {}, ); >@@ -1067,7 +1067,7 @@ subtest 'patron_attributes' => sub { > > $error = $result->{errors}->[0]; > is( $error->{patron_attribute_invalid_type}, 1 ); >- is( $error->{patron_id}, $cardnumber ); >+ is( $error->{borrowernumber}, $patron->borrowernumber ); > is( $error->{attribute_type_code}, $non_existent_attribute_type_code ); > > # NonRepeatable >@@ -1088,7 +1088,7 @@ subtest 'patron_attributes' => sub { > > $error = $result->{errors}->[0]; > is( $error->{patron_attribute_non_repeatable}, 1 ); >- is( $error->{patron_id}, $cardnumber ); >+ is( $error->{borrowernumber}, $patron->borrowernumber ); > is( $error->{attribute}->code, $normal_attribute_type->code ); > > # Don't preserve existing attributes >-- >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 28220
:
120549
|
120607
|
120608
|
120609
|
120610
|
120611
|
120612
|
120613
|
120614
|
120783
|
120784
|
120785
|
120786
|
120787
|
120788
|
120789
|
120790
|
120885
|
120886
|
120887
|
120888
|
120889
|
120890
|
120891
|
120892