Bug 19921: Fix update child when only one adult patron category exist
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 5 Jan 2018 19:36:31 +0000 (16:36 -0300)
committerFridolin Somers <fridolin.somers@biblibre.com>
Tue, 30 Jan 2018 08:09:39 +0000 (09:09 +0100)
commita4245efd875c74c9a342db0eb7cfbd72c8d6920d
tree5cf5e81c4859d475a7c1259be757b998af33eae8
parentb5ceced57697b97d727430c21fddd62c06830a51
Bug 19921: Fix update child when only one adult patron category exist

We are passing the Koha::Patron::Category object to the template instead
of the categorycode.

To reproduce this bug you must test in a system which has only one
patron category of the "adult" type. View the details of a patron with a
child-type patron category and choose More -> Update child to adult
patron.

This results in an error:

Can't call method "category_type" on an undefined value at
/home/vagrant/kohaclone/members/update-child.pl line 84.

The URL of the error page shows a problem with the parameters being
passed:

members/update-child.pl?op=update&borrowernumber=12345&catcode=Koha::Patron::Category=HASH(0xa168a18)&catcode_multi=

Test plan:
Make sure you have only 1 adult patron category
Update a child to adult
=> With this patch applied the error is gone and the patron has been
correctly updated

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit d735b4957b6073c6d8bf085cc81382dc4dc50d06)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
12 files changed:
circ/circulation.pl
members/boraccount.pl
members/mancredit.pl
members/maninvoice.pl
members/member-flags.pl
members/member-password.pl
members/moremember.pl
members/pay.pl
members/paycollect.pl
members/printfeercpt.pl
members/printinvoice.pl
members/readingrec.pl