Bugzilla – Attachment 119009 Details for
Bug 27857
Koha::Patron->extended_attributes skips checks
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27857: (use-it-in-real-life follow-up) Use a more fine-grained exception for mandatory attributes
Bug-27857-use-it-in-real-life-follow-up-Use-a-more.patch (text/plain), 1.75 KB, created by
Tomás Cohen Arazi (tcohen)
on 2021-03-30 14:03:35 UTC
(
hide
)
Description:
Bug 27857: (use-it-in-real-life follow-up) Use a more fine-grained exception for mandatory attributes
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2021-03-30 14:03:35 UTC
Size:
1.75 KB
patch
obsolete
>From 1ab6def4da1c9110fe94b259c8eca4bf64e2558d Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 30 Mar 2021 11:03:09 -0300 >Subject: [PATCH] Bug 27857: (use-it-in-real-life follow-up) Use a more > fine-grained exception for mandatory attributes > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/Patron.pm | 5 ++--- > t/db_dependent/Koha/Patron.t | 2 +- > 2 files changed, 3 insertions(+), 4 deletions(-) > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index 1160084ca63..f24ad0f8552 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -1578,9 +1578,8 @@ sub extended_attributes { > { join => 'borrower_attribute_types_branches' } > )->get_column('class'); > for my $type ( @required_attribute_types ) { >- Koha::Exceptions::Object::FKConstraint->throw( >- broken_fk => "$type", >- value => "$type", >+ Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute->throw( >+ type => $type, > ) if !$new_types->{$type}; > } > } >diff --git a/t/db_dependent/Koha/Patron.t b/t/db_dependent/Koha/Patron.t >index 98b079f4c33..d17fd77a04d 100755 >--- a/t/db_dependent/Koha/Patron.t >+++ b/t/db_dependent/Koha/Patron.t >@@ -644,7 +644,7 @@ subtest 'extended_attributes' => sub { > ] > ); > } >- 'Koha::Exceptions::Object::FKConstraint', >+ 'Koha::Exceptions::Patron::MissingMandatoryExtendedAttribute', > 'Exception thrown on missing mandatory attribute type'; > > is( $patron->extended_attributes->count, 0, 'Extended attributes storing rolled back' ); >-- >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 27857
:
117709
|
117710
|
117711
|
117938
|
117945
|
117946
|
117947
|
117948
|
117953
|
117954
|
117955
|
117956
|
117957
|
119009
|
119038
|
119040
|
119443
|
119937
|
119938