]> git.koha-community.org Git - koha.git/commit
Bug 16996: Do not explode if mandatory fields are missing
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 3 Aug 2016 15:28:24 +0000 (16:28 +0100)
committerJulian Maurice <julian.maurice@biblibre.com>
Wed, 24 Aug 2016 10:38:57 +0000 (12:38 +0200)
commit0688481749e474cf87d16e2bbdd6a60eff1ed9ff
tree8fab3e49127aec94c866a1b6402010c30bb4499e
parent5c36b1391ad7c08280fe89a60de70c47cd853849
Bug 16996: Do not explode if mandatory fields are missing

At the OPAC, if a patron modify his/her information and at least 1
mandatory field is missing, Koha will crash with
  Template process failed: undef error - Can't call method "description"

It is raised by Koha::Template::Plugin::Categories::GetName called with
an undefined categorycode.
The problem is that the values sent originaly are not sent back to the
template if the user missed something.
This patch makes that all info are resent to the template in order to
show the same form to the user.

Test plan:
0. Apply patch

1. Make sure that the categorycode is not hidden in the OPAC in:
     PatronSelfRegistrationBorrowerUnwantedField or PatronSelfModificationBorrowerUnwantedField

2. Add a required field in PatronSelfRegistrationBorrowerMandatoryField, for example email.

3. Go to Your Personal Details in the OPAC (opac-memberentry.pl) and leave blank the required field of point 2

4. Press "Submit update request"

There should be no software error.

NOTE: The warns will be floody on the logs.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Marc <veron@veron.ch>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
(cherry picked from commit 8c5cb134ee75aad77a9ba9b9fd84005fc0a9feb3)
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
(cherry picked from commit 803ad5b022e0c469d27336bdcdfb4966f3f01960)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
opac/opac-memberentry.pl