Bugzilla – Attachment 119380 Details for
Bug 28031
Koha::Patron::Attribute->_check_repeatable doesn't exclude the object's ID
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28031: Remove type from parameter of *_ok methods
Bug-28031-Remove-type-from-parameter-of-ok-methods.patch (text/plain), 1.92 KB, created by
Jonathan Druart
on 2021-04-09 13:28:15 UTC
(
hide
)
Description:
Bug 28031: Remove type from parameter of *_ok methods
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-04-09 13:28:15 UTC
Size:
1.92 KB
patch
obsolete
>From ed4fdda569120a66248bd195cce8383412e3066a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 9 Apr 2021 15:26:45 +0200 >Subject: [PATCH] Bug 28031: Remove type from parameter of *_ok methods > >--- > Koha/Patron/Attribute.pm | 16 +++++++--------- > 1 file changed, 7 insertions(+), 9 deletions(-) > >diff --git a/Koha/Patron/Attribute.pm b/Koha/Patron/Attribute.pm >index f0777a6520a..aaaefbcbb80 100644 >--- a/Koha/Patron/Attribute.pm >+++ b/Koha/Patron/Attribute.pm >@@ -46,16 +46,14 @@ sub store { > > my $self = shift; > >- my $type = $self->type; >- > Koha::Exceptions::Patron::Attribute::InvalidType->throw( type => $self->code ) >- unless $type; >+ unless $self->type; > > Koha::Exceptions::Patron::Attribute::NonRepeatable->throw( attribute => $self ) >- unless $self->repeatable_ok($type); >+ unless $self->repeatable_ok(); > > Koha::Exceptions::Patron::Attribute::UniqueIDConstraint->throw( attribute => $self ) >- unless $self->unique_ok($type); >+ unless $self->unique_ok(); > > return $self->SUPER::store(); > } >@@ -145,10 +143,10 @@ whether storing the current object state would break the repeatable constraint. > > sub repeatable_ok { > >- my ( $self, $type ) = @_; >+ my ( $self ) = @_; > > my $ok = 1; >- if ( !$type->repeatable ) { >+ if ( ! $self->type->repeatable ) { > my $params = { > borrowernumber => $self->borrowernumber, > code => $self->code >@@ -172,10 +170,10 @@ whether storing the current object state would break the unique constraint. > > sub unique_ok { > >- my ( $self, $type ) = @_; >+ my ( $self ) = @_; > > my $ok = 1; >- if ( $type->unique_id ) { >+ if ( $self->type->unique_id ) { > my $params = { code => $self->code, attribute => $self->attribute }; > > $params->{borrowernumber} = { '!=' => $self->borrowernumber } if $self->borrowernumber; >-- >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 28031
:
118792
|
118793
|
118794
|
118828
|
118829
|
118830
|
118831
|
118833
|
118859
|
118860
|
118861
|
118862
|
118863
|
119377
|
119378
|
119379
| 119380 |
119382