Bugzilla – Attachment 117548 Details for
Bug 27833
Koha::Exceptions::Patron::Attribute::* should have parameters
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27833: Make K::P::Attribute add the object to the exception
Bug-27833-Make-KPAttribute-add-the-object-to-the-e.patch (text/plain), 1.62 KB, created by
David Nind
on 2021-03-02 19:02:50 UTC
(
hide
)
Description:
Bug 27833: Make K::P::Attribute add the object to the exception
Filename:
MIME Type:
Creator:
David Nind
Created:
2021-03-02 19:02:50 UTC
Size:
1.62 KB
patch
obsolete
>From e7ce57dac7bac43d4f9e58c597c9c321e58ccdf3 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 2 Mar 2021 11:10:12 -0300 >Subject: [PATCH] Bug 27833: Make K::P::Attribute add the object to the > exception > >This patch makes the 'check_unique_id' and '_check_repeatable' methods >pass the 'attribute' parameter when throwing an exception. This way we >can provid emore meaningfull error messages. > >To test: >1. Apply the previous patches >2. Run > $ kshell > k$ prove t/db_dependent/Koha/Patron/Attributes.t >=> FAIL: The exceptions are not passed the attribute! >3. Apply this patch >4. Repeat 2 >=> SUCCESS: Tests pass! >5. Sign off :-D > >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/Patron/Attribute.pm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/Koha/Patron/Attribute.pm b/Koha/Patron/Attribute.pm >index 5afd674149..3e23a268e2 100644 >--- a/Koha/Patron/Attribute.pm >+++ b/Koha/Patron/Attribute.pm >@@ -133,7 +133,7 @@ sub _check_repeatable { > code => $self->code > } > )->count; >- Koha::Exceptions::Patron::Attribute::NonRepeatable->throw() >+ Koha::Exceptions::Patron::Attribute::NonRepeatable->throw( attribute => $self ) > if $attr_count > 0; > } > >@@ -161,7 +161,7 @@ sub check_unique_id { > my $unique_count = Koha::Patron::Attributes > ->search( $params ) > ->count; >- Koha::Exceptions::Patron::Attribute::UniqueIDConstraint->throw() >+ Koha::Exceptions::Patron::Attribute::UniqueIDConstraint->throw( attribute => $self ) > if $unique_count > 0; > } > >-- >2.11.0
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 27833
:
117516
|
117517
|
117518
|
117546
|
117547
|
117548
|
117676
|
117701
|
117702
|
117703
|
117704