Bugzilla – Attachment 57166 Details for
Bug 17521
Step 3 of patron modification editor not checking age limits
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17521: Added missing age limit check
Bug-17521-Added-missing-age-limit-check.patch (text/plain), 1.77 KB, created by
Jonathan Druart
on 2016-11-04 09:24:20 UTC
(
hide
)
Description:
Bug 17521: Added missing age limit check
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-11-04 09:24:20 UTC
Size:
1.77 KB
patch
obsolete
>From fdd1359a70ce1ba0bf3d2ac4f7a5fe6c7cd353d6 Mon Sep 17 00:00:00 2001 >From: radiuscz <radek.siman@centrum.cz> >Date: Mon, 31 Oct 2016 23:24:42 +0100 >Subject: [PATCH] Bug 17521: Added missing age limit check > >Following patron modification partial editor had no age constraint >checking: >/cgi-bin/koha/members/memberentry.pl?op=modify&borrowernumber=3&step=3 > >Test plan: >1) Apply the patch >2) Open profile of a patron >3) Click Edit under "Library use": http://prntscr.com/d1ghim >4) Change category to an invalid one (eg. Adult instead of Kid) >5) Error saying "Patron's age is incorrect for their category." should >be displayed. > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >Signed-off-by: Lucio Moraes <lmoraes@catalyst.net.nz> > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > members/memberentry.pl | 13 +++++++++++-- > 1 file changed, 11 insertions(+), 2 deletions(-) > >diff --git a/members/memberentry.pl b/members/memberentry.pl >index 95d2af0..27e6687 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -305,8 +305,17 @@ if ($op eq 'save' || $op eq 'insert'){ > : () > } > >- if ( $newdata{dateofbirth} ) { >- my $age = GetAge($newdata{dateofbirth}); >+ my $dateofbirth; >+ if ($op eq 'save' && $step == 3) { >+ my $borrower = C4::Members::GetMember(borrowernumber => $borrowernumber); >+ $dateofbirth = $borrower->{dateofbirth}; >+ } >+ else { >+ $dateofbirth = $newdata{dateofbirth}; >+ } >+ >+ if ( $dateofbirth ) { >+ my $age = GetAge($dateofbirth); > my $borrowercategory = Koha::Patron::Categories->find($categorycode); > my ($low,$high) = ($borrowercategory->dateofbirthrequired, $borrowercategory->upperagelimit); > if (($high && ($age > $high)) or ($age < $low)) { >-- >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 17521
:
57011
|
57121
|
57122
| 57166