Bugzilla – Attachment 165865 Details for
Bug 32610
Add ability to specify patron attribute as a date
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32610: (QA follow-up) Tidy Koha::Patron::Attribute
Bug-32610-QA-follow-up-Tidy-KohaPatronAttribute.patch (text/plain), 2.46 KB, created by
Martin Renvoize (ashimema)
on 2024-04-30 11:56:30 UTC
(
hide
)
Description:
Bug 32610: (QA follow-up) Tidy Koha::Patron::Attribute
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-04-30 11:56:30 UTC
Size:
2.46 KB
patch
obsolete
>From a547a413eb1bcc0577286451436a8a87aa5e3835 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 30 Apr 2024 12:49:33 +0100 >Subject: [PATCH] Bug 32610: (QA follow-up) Tidy Koha::Patron::Attribute > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Patron/Attribute.pm | 18 ++++++++---------- > 1 file changed, 8 insertions(+), 10 deletions(-) > >diff --git a/Koha/Patron/Attribute.pm b/Koha/Patron/Attribute.pm >index 00b55362ce1..5fc1b9111d1 100644 >--- a/Koha/Patron/Attribute.pm >+++ b/Koha/Patron/Attribute.pm >@@ -98,7 +98,7 @@ sub authorised_value { > authorised_value => $self->attribute, > } > ); >- return unless $av->count; # Data inconsistency >+ return unless $av->count; # Data inconsistency > return $av->next; > } > >@@ -114,7 +114,7 @@ displayed instead of the code. > =cut > > sub description { >- my ( $self) = @_; >+ my ($self) = @_; > if ( $self->type->authorised_value_category ) { > my $av = $self->authorised_value; > return $av ? $av->lib : ""; >@@ -147,10 +147,10 @@ whether storing the current object state would break the repeatable constraint. > > sub repeatable_ok { > >- my ( $self ) = @_; >+ my ($self) = @_; > > my $ok = 1; >- if ( ! $self->type->repeatable ) { >+ if ( !$self->type->repeatable ) { > my $params = { > borrowernumber => $self->borrowernumber, > code => $self->code >@@ -174,7 +174,7 @@ whether storing the current object state would break the unique constraint. > > sub unique_ok { > >- my ( $self ) = @_; >+ my ($self) = @_; > > my $ok = 1; > if ( $self->type->unique_id ) { >@@ -183,9 +183,7 @@ sub unique_ok { > $params->{borrowernumber} = { '!=' => $self->borrowernumber } if $self->borrowernumber; > $params->{id} = { '!=' => $self->id } if $self->in_storage; > >- my $unique_count = Koha::Patron::Attributes >- ->search( $params ) >- ->count; >+ my $unique_count = Koha::Patron::Attributes->search($params)->count; > > $ok = 0 if $unique_count > 0; > } >@@ -201,11 +199,11 @@ Checks if the value of the attribute is valid for the type > > sub value_ok { > >- my ( $self ) = @_; >+ my ($self) = @_; > > my $ok = 1; > if ( $self->type->is_date ) { >- eval { dt_from_string($self->attribute); }; >+ eval { dt_from_string( $self->attribute ); }; > if ($@) { > $ok = 0; > } >-- >2.44.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 32610
:
148400
|
148401
|
148402
|
148403
|
148404
|
148405
|
148825
|
148826
|
148827
|
148828
|
148829
|
148830
|
157862
|
157863
|
157864
|
157865
|
157866
|
157867
|
157868
|
158994
|
158995
|
158996
|
158997
|
158998
|
158999
|
159000
|
165747
|
165750
|
165854
|
165855
|
165856
|
165857
|
165858
|
165859
|
165860
|
165861
|
165862
|
165863
|
165864
| 165865 |
165925
|
165926