[Bug 8018] New: New subfields have a default max length of zero
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8018 Priority: P3 Change sponsored?: --- Bug ID: 8018 Assignee: gmcharlt@gmail.com Summary: New subfields have a default max length of zero Severity: major Classification: Unclassified OS: All Reporter: jcamins@cpbibliography.com Hardware: All Status: NEW Version: master Component: Cataloging Depends on: 7263 Product: Koha If you add a new subfield to a framework, the maximum length of the field defaults to 0, and the "Max length" box is hidden under "Display more constraints." The result is that if someone simply adds a new subfield, they will be unable to type in it, with no indication of what the problem is. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8018 Pablo AB <pablo.bianchi@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pablo.bianchi@gmail.com Depends on| |7855 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8018 --- Comment #1 from Pablo AB <pablo.bianchi@gmail.com> --- I think I solved this problem, just adding something like $row_data{maxlength} = "4"; near line 365 on marc_subfields_structure.pl: @ -360,6 +360,9 @@ -multiple => 0, ); + # This (I think) fix Bug #8018 + $row_data{maxlength} = "4"; + $row_data{link} = CGI::escapeHTML( $data->{'link'} ); $row_data{row} = $i; push( @loop_data, \%row_data ); -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8018 --- Comment #2 from Pablo AB <pablo.bianchi@gmail.com> --- 9999 as default value is much more reasonable. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8018 Pablo AB <pablo.bianchi@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|gmcharlt@gmail.com |pablo.bianchi@gmail.com --- Comment #3 from Pablo AB <pablo.bianchi@gmail.com> --- Created attachment 23483 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=23483&action=edit Set new subfields maxlenght by default to 9999. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8018 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8018 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #23483|0 |1 is obsolete| | --- Comment #4 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 23485 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=23485&action=edit Bug 8018: maxlenght should default to 9999 for subfields The default value for the marc_subfield_structure.maxlenght is 9999 in the DB. Currently the template passes an empty value which is casted to 0 by the CGI. This simple patch validates the input and converts to the default (9999) if not defined or 0. Another approach could be changing the 9999 default and/or treating 0 as 'no-limit'. PabloAB Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> Works by defaulting 0 or "" to 9999. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8018 --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 23487 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=23487&action=edit Bug 8018: (followup) make the default more explicit This patch: - Makes the new subfield tab show maxlength=9999 as default (instead of empty-then-zero). - Updates the help to make exlpicit that 0 or empty defaults to 9999. - Assumes all the subfields created with maxlength=0 inadvertedly are meant to mean "no limit" and hence update the database to reflect that. To test (this patch and Pablo's): - Edit a MARC framework, edit some field's subfields. - Use the 'New' tab to create a new subfield (choose an unused letter). - See in "More constrains" that the "Max length" field is empty. Leave it as-is. - Save the changes (the new subfield). - Edit the field again, verify that "Max length" is 0. - Try tu use the framework and the the field/subfield just created > FAIL - Apply the patches, upgrade - Try to use the framework/field/subfield > SUCCESS (0 was converted to 9999) - Repeat from the beggining, "Max length" should show 9999 on the new subfield tab. - Leave it empty, it is saved as 9999. Regards To+ Sponsored-by: Universidad Nacionald de Cordoba -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8018 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #23487|0 |1 is obsolete| | --- Comment #6 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 23488 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=23488&action=edit Bug 8018: (followup) make the default more explicit Edit: small typo Sponsored-by: Universidad Nacionald de Cordoba -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8018 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8018 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #23485|0 |1 is obsolete| | --- Comment #7 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 23758 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=23758&action=edit Bug 8018: maxlenght should default to 9999 for subfields The default value for the marc_subfield_structure.maxlenght is 9999 in the DB. Currently the template passes an empty value which is casted to 0 by the CGI. This simple patch validates the input and converts to the default (9999) if not defined or 0. Another approach could be changing the 9999 default and/or treating 0 as 'no-limit'. PabloAB Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> Works by defaulting 0 or "" to 9999. Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8018 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #23488|0 |1 is obsolete| | --- Comment #8 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 23759 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=23759&action=edit Bug 8018: (followup) make the default more explicit This patch: - Makes the new subfield tab show maxlength=9999 as default (instead of empty-then-zero). - Updates the help to make exlpicit that 0 or empty defaults to 9999. - Assumes all the subfields created with maxlength=0 inadvertedly are meant to mean "no limit" and hence update the database to reflect that. To test (this patch and Pablo's): - Edit a MARC framework, edit some field's subfields. - Use the 'New' tab to create a new subfield (choose an unused letter). - See in "More constrains" that the "Max length" field is empty. Leave it as-is. - Save the changes (the new subfield). - Edit the field again, verify that "Max length" is 0. - Try tu use the framework and the the field/subfield just created > FAIL - Apply the patches, upgrade - Try to use the framework/field/subfield > SUCCESS (0 was converted to 9999) - Repeat from the beggining, "Max length" should show 9999 on the new subfield tab. - Leave it empty, it is saved as 9999. Regards To+ Edit: small typo Sponsored-by: Universidad Nacionald de Cordoba Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8018 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8018 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #23758|0 |1 is obsolete| | Attachment #23759|0 |1 is obsolete| | --- Comment #9 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 23789 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=23789&action=edit [PASSED QA] Bug 8018: maxlenght should default to 9999 for subfields The default value for the marc_subfield_structure.maxlenght is 9999 in the DB. Currently the template passes an empty value which is casted to 0 by the CGI. This simple patch validates the input and converts to the default (9999) if not defined or 0. Another approach could be changing the 9999 default and/or treating 0 as 'no-limit'. PabloAB Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> Works by defaulting 0 or "" to 9999. Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8018 --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 23790 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=23790&action=edit [PASSED QA] Bug 8018: (followup) make the default more explicit This patch: - Makes the new subfield tab show maxlength=9999 as default (instead of empty-then-zero). - Updates the help to make exlpicit that 0 or empty defaults to 9999. - Assumes all the subfields created with maxlength=0 inadvertedly are meant to mean "no limit" and hence update the database to reflect that. To test (this patch and Pablo's): - Edit a MARC framework, edit some field's subfields. - Use the 'New' tab to create a new subfield (choose an unused letter). - See in "More constrains" that the "Max length" field is empty. Leave it as-is. - Save the changes (the new subfield). - Edit the field again, verify that "Max length" is 0. - Try tu use the framework and the the field/subfield just created > FAIL - Apply the patches, upgrade - Try to use the framework/field/subfield > SUCCESS (0 was converted to 9999) - Repeat from the beggining, "Max length" should show 9999 on the new subfield tab. - Leave it empty, it is saved as 9999. Regards To+ Edit: small typo Sponsored-by: Universidad Nacionald de Cordoba Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Passes QA script and tests in t and xt. Tested: - deleting an existing subfield - adding a new subfield with new default 9999 - editing the new subfield, changing value to 8888 - deleting new subfield - adding new subfield, using 8888 as length -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8018 --- Comment #11 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 23791 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=23791&action=edit Bug 8018: Follow-up - fixing some wrong capitalization Fixes capitalization in 2 places: - Delete a subfield - Yes/No options - Edit a subfield - Edit subfield -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8018 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |gmcharlt@gmail.com --- Comment #12 from Galen Charlton <gmcharlt@gmail.com> --- Pushed to master. Thanks Pablo and Tomás! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8018 Fridolin SOMERS <fridolyn.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |Pushed to Stable CC| |fridolyn.somers@biblibre.co | |m --- Comment #13 from Fridolin SOMERS <fridolyn.somers@biblibre.com> --- Patches pushed to 3.14.x, will be in 3.14.2. (creates version 3.14.01.005) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8018 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #14 from Tomás Cohen Arazi <tomascohen@gmail.com> --- This patch has been pushed to 3.12.x, will be in 3.12.11. Thanks Pablo and Katrina! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org