[Koha-bugs] [Bug 17307] Edit button in patron search page doesn' t work without a category code

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Sep 16 15:09:17 CEST 2016


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17307

Andreas Roussos <arouss1980 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|koha-bugs at lists.koha-commun |arouss1980 at gmail.com
                   |ity.org                     |
                URL|                            |/cgi-bin/koha/members/membe
                   |                            |r.pl

--- Comment #1 from Andreas Roussos <arouss1980 at gmail.com> ---
I'm no Perl expert but here's what I've found so far in my attempt
to debug this.

members/memberentry.pl in the current master (0254fd7):

372 if ( ($op eq 'modify' || $op eq 'insert' || $op eq 'save'|| $op eq
'duplicate') and ($step == 0 or $step == 3 )){
373     unless ($newdata{'dateexpiry'}){
374         my $patron_category = Koha::Patron::Categories->find(
$newdata{categorycode} );
375         $newdata{'dateexpiry'} = $patron_category->get_expiry_date(
$newdata{dateenrolled} );
376     }
377 }

The problem in line 375 is that the value of the $patron_category
variable is undefined, because at line 374 $newdata{categorycode}
comes from $input->param(), as per the comment at line 168. Since
no 'categorycode' value is passed in the URL, the call to
Koha::Patron::Categories->find() fails.

So, it seems that the easy fix is to add the categorycode in the URL.
It's trivial to fix so I'll provide a patch soon.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list