Bug 25309 - Unable to save patron if streetnumber is too long
Summary: Unable to save patron if streetnumber is too long
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P1 - high normal
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 25311
Blocks:
  Show dependency treegraph
 
Reported: 2020-04-28 22:16 UTC by David Roberts
Modified: 2021-12-13 21:08 UTC (History)
6 users (show)

See Also:
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:


Attachments
Sandbox Error Trace Log (12.46 KB, text/plain)
2020-04-28 22:16 UTC, David Roberts
Details
Bug 25309: Limit size of streetnumber field to 10 (3.18 KB, patch)
2020-04-29 12:59 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 25309: Limit size of streetnumber field to 10 (3.25 KB, patch)
2020-04-29 15:45 UTC, David Roberts
Details | Diff | Splinter Review
Bug 25309: Limit size of streetnumber field to 10 (3.31 KB, patch)
2020-05-01 22:33 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 ^^