[Bug 27461] New: Fix leader length below 40 positions in cataloguing plugin
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27461 Bug ID: 27461 Summary: Fix leader length below 40 positions in cataloguing plugin Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Cataloging Assignee: koha-bugs@lists.koha-community.org Reporter: m.de.rooy@rijksmuseum.nl QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl If the length is below 40 chars, the string is not extended to 40 positions. I am not completely sure if there is more going on, but this could be a first fix anyway. I came across shorter fields in our data. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27461 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Fix leader length below 40 |Fix field 008 length below |positions in cataloguing |40 positions in cataloguing |plugin |plugin -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27461 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27461 --- Comment #1 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 115247 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115247&action=edit Bug 27461: Fix field 008 length below 40 positions in cataloguing plugin Test plan: Make contents of field 008 shorter in editor before clicking plugin. Save in plugin. Verify that character length in field 008 is now 40 positions. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27461 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |m.de.rooy@rijksmuseum.nl |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27461 --- Comment #2 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- NOTE FOR QA: Using repeat is nicer code but is not available in IE. Although we actually should not want that anyway ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27461 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115247|0 |1 is obsolete| | --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 115248 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=115248&action=edit Bug 27461: Fix field 008 length below 40 positions in cataloguing plugin Test plan: Make contents of field 008 shorter in editor before clicking plugin. Save in plugin. Verify that character length in field 008 is now 40 positions. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27461 Phil Ringnalda <phil@chetcolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |In Discussion CC| |phil@chetcolibrary.org --- Comment #4 from Phil Ringnalda <phil@chetcolibrary.org> --- A space is an invalid character in some positions, a character with a particular meaning in some positions, and only rarely a synonym for "dunno what should be here." | is closer to the mark, since it's defined as "no attempt to code" for every position except 0-5. However, just pipe-padding instead of space-padding won't work except in the case where value.length going into the plugin was 39, because if it's 38 or less, the plugin is *broken*. If the length going in is 37 (delete everything back to and including position 37, the last letter of the language) and you then use the plugin to change the value for one of the last two positions, your value will actually be put into position 37 rather than where it belongs. Do what seems reasonable until you try it, type 210220s in the text input and then trigger the plugin, and fill things in in random order, first setting the Cataloging source so you don't forget, then seeing that Index and Literary form and Biography are wrong and changing them, then going back up to put in your single date without realizing you're also supposed to put in spaces for the second date, then go back down and put in the language, then back up for the place of publication. You now have a random-length 008 with random letters in random spots. So, three cases: The value going into the plugin is 0 characters long. That is already handled by creating a value with some imperfect default values The value going into the plugin is 1 to 5 characters long. That's a broken date-entered, which can't be fixed with pipes, it can only be deleted and treated the same as 0 characters. The value going into the plugin is 6-39 characters long, which can be fixed by either applying our somewhat imperfect default values to any missing characters, or less-imperfectly by pipe-filling. Inconveniently, you can't just pad with either pipes or the remaining characters from our default blindly, since filling position 35-39 with pipes is just fine, but filling position 36-39 is invalid, since "e||" is not a valid language code. So it's an awkward case of length 6-7 you can pad, 8-11 you have to truncate to 7 and pad, 12 you can pad, 13-15 you have to truncate to 12 and pad, etc. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27461 --- Comment #5 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Phil Ringnalda from comment #4)
Inconveniently, you can't just pad with either pipes or the remaining characters from our default blindly, since filling position 35-39 with pipes is just fine, but filling position 36-39 is invalid, since "e||" is not a valid language code. So it's an awkward case of length 6-7 you can pad, 8-11 you have to truncate to 7 and pad, 12 you can pad, 13-15 you have to truncate to 12 and pad, etc.
Phil. I added a proposal to right pad with characters from the default from the last complete data element onwards. Viewing block 18-34 as one element, since it depends on material type. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27461 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|Trivial patch |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27461 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #115248|0 |1 is obsolete| | --- Comment #6 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 123973 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=123973&action=edit Bug 27461: Move hardcoded value to module Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27461 --- Comment #7 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 123974 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=123974&action=edit Bug 27461: Add tests for biblio_008 Test plan: Run t/db_dependent/FrameworkPlugin.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27461 --- Comment #8 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 123975 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=123975&action=edit Bug 27461: Right pad with default elements for too short 008s Note that we treat the elements 18-34 as one block of elements, since its subdivision may vary. E.g. if you pass 24 characters to the form, it will use the first 18 chars (until the last complete element) and pad with default elements from position 18-39. Test plan: [1] Go to addbiblio. Make sure that 008 is connected to the plugin. [2] Backspace field 008 a bit, click on the plugin button. [3] Verify that the last elements come from the default. [4] Repeat for a few different lengths. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27461 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27461 --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- For the record noting here that we are using as default pipe chars in the country field. MARC specs say: Three fill characters (|||) may be used in place of a valid code, but their use in 008/15-17 is discouraged. If we want to change that too, please open up a new report ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27461 Phil Ringnalda <phil@chetcolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #123973|0 |1 is obsolete| | --- Comment #10 from Phil Ringnalda <phil@chetcolibrary.org> --- Created attachment 124433 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=124433&action=edit Bug 27461: Move hardcoded value to module Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27461 Phil Ringnalda <phil@chetcolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #123974|0 |1 is obsolete| | --- Comment #11 from Phil Ringnalda <phil@chetcolibrary.org> --- Created attachment 124434 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=124434&action=edit Bug 27461: Add tests for biblio_008 Test plan: Run t/db_dependent/FrameworkPlugin.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27461 Phil Ringnalda <phil@chetcolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #123975|0 |1 is obsolete| | --- Comment #12 from Phil Ringnalda <phil@chetcolibrary.org> --- Created attachment 124435 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=124435&action=edit Bug 27461: Right pad with default elements for too short 008s Note that we treat the elements 18-34 as one block of elements, since its subdivision may vary. E.g. if you pass 24 characters to the form, it will use the first 18 chars (until the last complete element) and pad with default elements from position 18-39. Test plan: [1] Go to addbiblio. Make sure that 008 is connected to the plugin. [2] Backspace field 008 a bit, click on the plugin button. [3] Verify that the last elements come from the default. [4] Repeat for a few different lengths. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27461 Phil Ringnalda <phil@chetcolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27461 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #124433|0 |1 is obsolete| | --- Comment #13 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 125349 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125349&action=edit Bug 27461: Move hardcoded value to module Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27461 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #124434|0 |1 is obsolete| | --- Comment #14 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 125350 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125350&action=edit Bug 27461: Add tests for biblio_008 Test plan: Run t/db_dependent/FrameworkPlugin.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27461 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #124435|0 |1 is obsolete| | --- Comment #15 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Created attachment 125351 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=125351&action=edit Bug 27461: Right pad with default elements for too short 008s Note that we treat the elements 18-34 as one block of elements, since its subdivision may vary. E.g. if you pass 24 characters to the form, it will use the first 18 chars (until the last complete element) and pad with default elements from position 18-39. Test plan: [1] Go to addbiblio. Make sure that 008 is connected to the plugin. [2] Backspace field 008 a bit, click on the plugin button. [3] Verify that the last elements come from the default. [4] Repeat for a few different lengths. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27461 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA CC| |martin.renvoize@ptfs-europe | |.com --- Comment #16 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Nice clear code, works as expected and no regressions found. Tests all passing. Passing QA, thanks guys. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27461 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |21.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27461 --- Comment #17 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Pushed to master for 21.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27461 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com Status|Pushed to master |Pushed to stable Version(s)|21.11.00 |21.11.00,21.05.05 released in| | --- Comment #18 from Kyle M Hall <kyle@bywatersolutions.com> --- Pushed to 21.05.x for 21.05.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27461 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|21.11.00,21.05.05 |21.11.00,21.05.05,20.11.11 released in| | Status|Pushed to stable |Pushed to oldstable CC| |fridolin.somers@biblibre.co | |m --- Comment #19 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 20.11.x for 20.11.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27461 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Pushed to oldstable |RESOLVED CC| |victor@tuxayo.net --- Comment #20 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org