Bug 8431

Summary: Increase the borrower attribute field size from 64 characters to 255
Product: Koha Reporter: Kyle M Hall <kyle>
Component: PatronsAssignee: Bugs List <koha-bugs>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P5 - low CC: chris, gmcharlt, jonathan.druart, koha.sekjal, kyle.m.hall, paul.poulain
Version: 3.10   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 8431 - Increase the borrower attribute field size from 64 characters to 255
Bug 8431 - Increase the borrower attribute field size from 64 characters to 255
[SIGNED-OFF] Bug 8431 - Increase the borrower attribute field size from 64 characters to 255
Bug 8431 - Followup - Increase maxlength for borrower attributes text input
Bug 8431 - Followup - Switch from text input to textarea
Bug 8431 - Followup - Switch from text input to textarea
[SIGNED-OFF] Bug 8431 - Followup - Switch from text input to textarea
Bug 8431 - Follow-up - Correct and consolidate JavaScript for clearing rows
Bug 8431 [SIGNED-OFF][FOLLOW-UP] Increase the borrower attribute field size from 64 characters to 255
Bug 8431 - Followup - Use TT filter html_line_break on extended attributes.

Description Kyle M Hall 2012-07-12 15:32:45 UTC
Some libraries would like to store more verbose data in a borrower attribute field. I think it would be reasonable to up the character limit from 64 to 255.
Comment 1 Kyle M Hall 2012-07-12 15:33:35 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2012-07-20 18:27:31 UTC
The description of this database update is "Add system preference IntranetSlipPrinterJS."
Comment 3 Kyle M Hall 2012-07-23 20:23:11 UTC Comment hidden (obsolete)
Comment 4 Chris Cormack 2012-07-24 01:43:58 UTC
Tested

* Upgrade to 3.09.00.XXX done (Increase the maximum size of a borrower attribute value)

Checked the db
 borrower_attributes | CREATE TABLE `borrower_attributes` (
  `borrowernumber` int(11) NOT NULL,
  `code` varchar(10) NOT NULL,
  `attribute` varchar(255) DEFAULT NULL,
  `password` varchar(64) DEFAULT NULL,
  KEY `borrowernumber` (`borrowernumber`),
  KEY `code_attribute` (`code`,`attribute`),
  CONSTRAINT `borrower_attributes_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `borrower_attributes_ibfk_2` FOREIGN KEY (`code`) REFERENCES `borrower_attribute_types` (`code`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
Comment 5 Chris Cormack 2012-07-24 01:44:17 UTC
Created attachment 11097 [details] [review]
[SIGNED-OFF] Bug 8431 - Increase the borrower attribute field size from 64 characters to 255

Some libraries would like to store more verbose data in a borrower attribute field.
This commit increases the maximum length of a borrower attribute from 64 characters
to 255 characters.

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Comment 6 Jonathan Druart 2012-07-24 08:36:20 UTC
QA Comments:
The patch modifies the DB structure but template must be modified too.

At least member/memberentrygen.tt:
    <input id="patron_attr_1" type="text" name="patron_attr_1" value="" maxlength="64">

I didn't verify if others occurrences exist.
Comment 7 Kyle M Hall 2012-07-24 15:23:48 UTC Comment hidden (obsolete)
Comment 8 Kyle M Hall 2012-07-24 15:36:37 UTC Comment hidden (obsolete)
Comment 9 Owen Leonard 2012-07-26 14:31:16 UTC
I know this is minor, but a textarea needs both a "rows" attribute and a "cols" attribute in order to be valid. Our validity score may not be 100% but let's not introduce new issues.
Comment 10 Kyle M Hall 2012-07-26 17:21:01 UTC Comment hidden (obsolete)
Comment 11 Owen Leonard 2012-07-27 12:59:08 UTC
Created attachment 11166 [details] [review]
[SIGNED-OFF] Bug 8431 - Followup - Switch from text input to textarea
Comment 12 Owen Leonard 2012-07-27 13:05:15 UTC Comment hidden (obsolete)
Comment 13 Jonathan Druart 2012-07-27 14:52:47 UTC
Created attachment 11169 [details] [review]
Bug 8431 [SIGNED-OFF][FOLLOW-UP] Increase the borrower attribute field size from 64 characters to 255

This follow-up consolidates the JavaScript for clearing the
contents of a row of patron attributes while expanding it
to include all inputs, selects, and textareas within that row.

Previously password-type fields would be excluded.

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 14 Ian Walls 2012-08-17 15:15:41 UTC
1st patch:  just increases size of field in new and upgraded installs.  Passed QA

2nd patch:  changes input to text area to accomodate new size.  Passed QA

3rd patch:  jQuery consolidation of input clearing.  Passed QA.
Comment 15 Paul Poulain 2012-09-04 15:36:35 UTC
A small problem that require a follow-up before I push the patch:
  * enter an attribute on 2 (or more lines)
  * save the patron
  * the attribute is displayed on 1 line (CR not replaced by <br/>)

MArking failed QA. switch back to passed QA once you've added a fix (should just require a |html in the template)
Comment 16 Kyle M Hall 2012-09-10 13:16:08 UTC
Created attachment 12106 [details] [review]
Bug 8431 - Followup - Use TT filter html_line_break on extended attributes.
Comment 17 Paul Poulain 2012-09-13 09:21:28 UTC
(In reply to comment #16)
> Created attachment 12106 [details] [review]
> Bug 8431 - Followup - Use TT filter html_line_break on extended attributes.

Thx for the follow-up, but you missed that is is also neede in moremember.tt and opac-userupdate.pl

I've updated the 2 templates in a follow-up

Patch pushed