Bugzilla – Attachment 119042 Details for
Bug 23666
Add routes for extended patron attributes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23666: (follow-up) Adjust to new exceptions
Bug-23666-follow-up-Adjust-to-new-exceptions.patch (text/plain), 2.16 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-03-31 12:01:04 UTC
(
hide
)
Description:
Bug 23666: (follow-up) Adjust to new exceptions
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-03-31 12:01:04 UTC
Size:
2.16 KB
patch
obsolete
>From 484406124117abb3d7b256b3d741f22187d421fa Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 31 Mar 2021 08:59:10 -0300 >Subject: [PATCH] Bug 23666: (follow-up) Adjust to new exceptions > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/REST/V1/Patrons/Attributes.pm | 7 ++----- > t/db_dependent/api/v1/patrons_extended_attributes.t | 2 +- > 2 files changed, 3 insertions(+), 6 deletions(-) > >diff --git a/Koha/REST/V1/Patrons/Attributes.pm b/Koha/REST/V1/Patrons/Attributes.pm >index 75a43aa9c8b..f769765a738 100644 >--- a/Koha/REST/V1/Patrons/Attributes.pm >+++ b/Koha/REST/V1/Patrons/Attributes.pm >@@ -205,13 +205,10 @@ sub overwrite { > openapi => { error => "$_" } > ); > } >- elsif ( $_->isa('Koha::Exceptions::Object::FKConstraint') ) { >+ elsif ( $_->isa('Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute') ) { > return $c->render( > status => 400, >- openapi => { >- error => 'Missing mandatory attribute of type "' >- . $_->value . '".' >- } >+ openapi => { error => "$_" } > ); > > } >diff --git a/t/db_dependent/api/v1/patrons_extended_attributes.t b/t/db_dependent/api/v1/patrons_extended_attributes.t >index 7de141a5d1a..1766576fcb4 100755 >--- a/t/db_dependent/api/v1/patrons_extended_attributes.t >+++ b/t/db_dependent/api/v1/patrons_extended_attributes.t >@@ -301,7 +301,7 @@ subtest 'overwrite() tests' => sub { > . '/extended_attributes' => json => > [ { type => $unique_attr_type->code, value => $value_1 } ] ) > ->status_is(400) >- ->json_is( '/error' => 'Missing mandatory attribute of type "' . $mandatory_attr_type->code . '".' ); >+ ->json_is( '/error' => "Missing mandatory extended attribute (type=" . $mandatory_attr_type->code . ')' ); > > $patron->add_extended_attribute({ code => $repeatable_attr_type->code, attribute => 'repeatable_1' }); > $patron->add_extended_attribute({ code => $repeatable_attr_type->code, attribute => 'repeatable_2' }); >-- >2.31.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 23666
:
118508
|
118509
|
118510
|
118550
|
118699
|
118700
|
118701
|
118702
|
118818
|
118854
|
119042
|
119388
|
119389
|
119390
|
119391
|
119392
|
119393