Bug 25309

Summary: Unable to save patron if streetnumber is too long
Product: Koha Reporter: David Roberts <david.roberts>
Component: PatronsAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P1 - high CC: 1joynelson, gmcharlt, jonathan.druart, kyle.m.hall, martin.renvoize, victor
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.05.00, 19.11.06
Circulation function:
Bug Depends on: 25311    
Bug Blocks:    
Attachments: Sandbox Error Trace Log
Bug 25309: Limit size of streetnumber field to 10
Bug 25309: Limit size of streetnumber field to 10
Bug 25309: Limit size of streetnumber field to 10

Description David Roberts 2020-04-28 22:16:50 UTC
Created attachment 103889 [details]
Sandbox Error Trace Log

On master, it is not possible to create patrons. You get an error 
Can't call method "extended_attributes" on an undefined value at /kohadevbox/koha/members/memberentry.pl line 560

This happens whether you populate the delivered extended attribute (SHOW_BCODE) or not. 

I have reproduced this on my own dev server, and on the Sandboxes. I've attached the error trace log from the sandboxes.
Comment 1 Jonathan Druart 2020-04-29 12:51:21 UTC
The real error was lost in the log file:
"Data too long for column 'streetnumber'"
Comment 2 Jonathan Druart 2020-04-29 12:59:24 UTC
Created attachment 103933 [details] [review]
Bug 25309: Limit size of streetnumber field to 10

It's its size in DB (varchar(10))

Test plan:
Create or editing a patron and confirm that you fill in more than 10
characters in the streetnumber field
Save
=> The patron has been correctly created/updated
Comment 3 David Roberts 2020-04-29 15:45:50 UTC
Created attachment 103956 [details] [review]
Bug 25309: Limit size of streetnumber field to 10

It's its size in DB (varchar(10))

Test plan:
Create or editing a patron and confirm that you fill in more than 10
characters in the streetnumber field
Save
=> The patron has been correctly created/updated

Signed-off-by: David Roberts <david@koha-ptfs.co.uk>
Comment 4 Martin Renvoize (ashimema) 2020-05-01 12:12:32 UTC
We should probably also disable autofill on this form here perhaps?

I think the original issue was found due to an erroneous autofill.
Comment 5 Katrin Fischer 2020-05-01 22:33:43 UTC
Created attachment 104159 [details] [review]
Bug 25309: Limit size of streetnumber field to 10

It's its size in DB (varchar(10))

Test plan:
Create or editing a patron and confirm that you fill in more than 10
characters in the streetnumber field
Save
=> The patron has been correctly created/updated

Signed-off-by: David Roberts <david@koha-ptfs.co.uk>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Martin Renvoize (ashimema) 2020-05-04 07:42:23 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 7 Joy Nelson 2020-05-11 16:33:29 UTC
not backported to 19.11.  will try again if 25311 is rebased.
Comment 8 Jonathan Druart 2020-05-12 08:50:31 UTC
(In reply to Joy Nelson from comment #7)
> not backported to 19.11.  will try again if 25311 is rebased.

Apply cleanly on top of the 19.11.x rebased patches from bug 25311.
Comment 9 Joy Nelson 2020-05-19 23:53:30 UTC
backported to 19.11.x for 19.11.06
Comment 10 Victor Grousset/tuxayo 2020-06-04 17:34:10 UTC
Can't be backported to 19.05.x due to dependence on bug 25311.

So if someone is interested in this bug being backported to 19.05.x, send help to bug 25311 ^^