Bugzilla – Attachment 61662 Details for
Bug 17828
Koha::Patron::Attribute->store should raise an exception if unique_id is being broken
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17828: Use Koha::Patron::Attributes instead of _resultset
Bug-17828-Use-KohaPatronAttributes-instead-of-resu.patch (text/plain), 1.30 KB, created by
Jonathan Druart
on 2017-03-28 14:39:33 UTC
(
hide
)
Description:
Bug 17828: Use Koha::Patron::Attributes instead of _resultset
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-03-28 14:39:33 UTC
Size:
1.30 KB
patch
obsolete
>From 064e5a69d21ec6cb5c6220ea1ba30c1062e6be07 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 28 Mar 2017 11:39:09 -0300 >Subject: [PATCH] Bug 17828: Use Koha::Patron::Attributes instead of _resultset > >--- > Koha/Patron/Attribute.pm | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > >diff --git a/Koha/Patron/Attribute.pm b/Koha/Patron/Attribute.pm >index 52eb9c1..79b7eaf 100644 >--- a/Koha/Patron/Attribute.pm >+++ b/Koha/Patron/Attribute.pm >@@ -109,8 +109,7 @@ sub _check_repeatable { > my $self = shift; > > if ( !$self->type->repeatable ) { >- my $attr_count >- = Koha::Database->new->schema->resultset( $self->_type )->search( >+ my $attr_count = Koha::Patron::Attributes->search( > { borrowernumber => $self->borrowernumber, > code => $self->code > } >@@ -135,8 +134,7 @@ sub _check_unique_id { > my $self = shift; > > if ( $self->type->unique_id ) { >- my $unique_count >- = Koha::Database->new->schema->resultset( $self->_type ) >+ my $unique_count = Koha::Patron::Attributes > ->search( { code => $self->code, attribute => $self->attribute } ) > ->count; > Koha::Exceptions::Patron::Attribute::UniqueIDConstraint->throw() >-- >2.1.4
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 17828
:
58526
|
58527
|
58557
|
58558
|
61505
|
61506
|
61547
|
61644
|
61662
|
61703
|
61704
|
61705
|
61706
|
61707
|
61708
|
61709