Bug 25311: Better error handling when creating a patron
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 29 Apr 2020 12:38:41 +0000 (14:38 +0200)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 4 May 2020 07:38:35 +0000 (08:38 +0100)
commit580e6fabff5ec0f564e200a6b2fe42955661b5b7
treece5d932ef6189607960556dfeebce160e4d9f775
parent39138e860ce8e3eb54d2788ba32728baf03122c0
Bug 25311: Better error handling when creating a patron

This is still not ideal but brings a bit of enhancement.

One possible problem is that the patron creation will fail if the
streetnumber field is too long (borrowers.streetnumber is varchar(10).

Test plan:
0. Don't apply this patch
1. Create a new patron with a streetnumber longer than 10 characters
2. Save
=> The patron has not been created and the app explodes
The error is about extended_attributes and not meaningful
Can't call method "extended_attributes" on an undefined value at /kohadevbox/koha/members/memberentry.pl line 560
3. Apply the patch
4. Repeat 1. and 2
=> You get a warning on the interface and you still see the creation
form
5. Check the logs
=> The error is meaningful
"Data too long for column 'streetnumber'"

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt
members/memberentry.pl