[Bug 38895] New: In advanced editor, the fixed data helpers put '#' instead of space in record content
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38895 Bug ID: 38895 Summary: In advanced editor, the fixed data helpers put '#' instead of space in record content Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: trivial Priority: P5 - low Component: Cataloging Assignee: koha-bugs@lists.koha-community.org Reporter: januszop@gmail.com QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl When editing a bibliographic record in advanced editor, there are helpers for fixed data coded fields (like 008). Like in the standard editor, empty value (space) is represented by a hash sign. But unlike in the standard editor, the hash sign is not converted into a space but remains as '#' in the saved record. This is obviously wrong. For the standard editor there is a line: valNode = valNode.replace("#", " "); in xmlControlfield.js An analogous replace('#',' ') is missing when constructing the <select> in cateditor/widget.js (line 164). -- 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=38895 Phil Ringnalda <phil@chetcolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |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=38895 Janusz Kaczmarek <januszop@gmail.com> 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=38895 --- Comment #1 from Janusz Kaczmarek <januszop@gmail.com> --- Created attachment 176574 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=176574&action=edit Bug 38895: In advanced editor, the fixed data helpers put '#' instead of space in record content When editing a bibliographic record in advanced editor, there are helpers for fixed data coded fields (like 008). Like in the standard editor, empty value (space) is represented by a hash sign. But unlike in the standard editor, the hash sign is not converted into a space but remains as '#' in the saved record. This is obviously wrong. Test plan: ========== 1. Ensure to have EnableAdvancedCatalogingEditor set to 'enable'. 2. Create of edit a record, choosing for one of one-letter codes an empty value (represented by '#' in the helper). 3. Save the record, control in 'MARC preview' that you got a hash sign in the 008 field instead of a space. 4. Apply the patch ; restart all. 5. Open a record in advanced editor, refresh the page to reload the java script (Shift+Ctrl+R or another appropriate shortcut). Edit the 008 field again choosing for one of one-letter codes an empty value. 6. Save the record, control in 'MARC preview' that there is a space and not the hash sign. Sponsored-by: Ignatianum University in Cracow -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38895 Janusz Kaczmarek <januszop@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Change sponsored?|--- |Sponsored Assignee|koha-bugs@lists.koha-commun |januszop@gmail.com |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=38895 Roman Dolny <roman.dolny@jezuici.pl> 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=38895 Roman Dolny <roman.dolny@jezuici.pl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #176574|0 |1 is obsolete| | --- Comment #2 from Roman Dolny <roman.dolny@jezuici.pl> --- Created attachment 176581 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=176581&action=edit Bug 38895: In advanced editor, the fixed data helpers put '#' instead of space in record content When editing a bibliographic record in advanced editor, there are helpers for fixed data coded fields (like 008). Like in the standard editor, empty value (space) is represented by a hash sign. But unlike in the standard editor, the hash sign is not converted into a space but remains as '#' in the saved record. This is obviously wrong. Test plan: ========== 1. Ensure to have EnableAdvancedCatalogingEditor set to 'enable'. 2. Create of edit a record, choosing for one of one-letter codes an empty value (represented by '#' in the helper). 3. Save the record, control in 'MARC preview' that you got a hash sign in the 008 field instead of a space. 4. Apply the patch ; restart all. 5. Open a record in advanced editor, refresh the page to reload the java script (Shift+Ctrl+R or another appropriate shortcut). Edit the 008 field again choosing for one of one-letter codes an empty value. 6. Save the record, control in 'MARC preview' that there is a space and not the hash sign. Sponsored-by: Ignatianum University in Cracow Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38895 ByWater Sandboxes <bws.sandboxes@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #176581|0 |1 is obsolete| | --- Comment #3 from ByWater Sandboxes <bws.sandboxes@gmail.com> --- Created attachment 176582 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=176582&action=edit Bug 38895: In advanced editor, the fixed data helpers put '#' instead of space in record content When editing a bibliographic record in advanced editor, there are helpers for fixed data coded fields (like 008). Like in the standard editor, empty value (space) is represented by a hash sign. But unlike in the standard editor, the hash sign is not converted into a space but remains as '#' in the saved record. This is obviously wrong. Test plan: ========== 1. Ensure to have EnableAdvancedCatalogingEditor set to 'enable'. 2. Create of edit a record, choosing for one of one-letter codes an empty value (represented by '#' in the helper). 3. Save the record, control in 'MARC preview' that you got a hash sign in the 008 field instead of a space. 4. Apply the patch ; restart all. 5. Open a record in advanced editor, refresh the page to reload the java script (Shift+Ctrl+R or another appropriate shortcut). Edit the 008 field again choosing for one of one-letter codes an empty value. 6. Save the record, control in 'MARC preview' that there is a space and not the hash sign. Sponsored-by: Ignatianum University in Cracow Signed-off-by: esther <esther@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38895 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com --- Comment #4 from Jonathan Druart <jonathan.druart@gmail.com> --- Maybe I don't understand the problem, but for me your patch introduces a regression. I put a "#" on purpose (maybe it's silly, I was just trying to break your patch!). Before the patch: Editor: 008 250123b ||||#||| |||| 00| 0 eng d Marc detail: @ 250123b ||||#||| |||| 00| 0 eng d After the patch: Editor: 008 250123b |||| ||| |||| 00| 0 eng d The # disappeared here. Marc defailt: @ 250123b ||||#||| |||| 00| 0 eng d I didn't find differences when not using "#". -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38895 --- Comment #5 from Janusz Kaczmarek <januszop@gmail.com> --- (In reply to Jonathan Druart from comment #4)
Maybe I don't understand the problem, but for me your patch introduces a regression.
I put a "#" on purpose (maybe it's silly, I was just trying to break your patch!).
Before the patch: Editor: 008 250123b ||||#||| |||| 00| 0 eng d Marc detail: @ 250123b ||||#||| |||| 00| 0 eng d
After the patch: Editor: 008 250123b |||| ||| |||| 00| 0 eng d The # disappeared here. Marc defailt: @ 250123b ||||#||| |||| 00| 0 eng d
I didn't find differences when not using "#".
Well, depends of what are you starting with. If you already have # in 008, it will not show in the editor, like any other character put at the position where it is not legal (= not present at the list). For instance, if you had 008/29 = '2' in the record you would see _ in the editor. The main point is not to introduce '#' in 008, because this is not legal character. There should be an empty character (= space) where in the MARC 21 documentation (https://loc.gov/marc/bibliographic/bd008b.html) is used '#' ('#' is conventional character in MARC 21 doc for a blank). This is what our "traditional" editor does - it shows '#' in the legend but puts ' ' (a blank) into 008 and this is right. The advanced editor before the patch puts '#' in the content of the 008 which is undoubtedly wrong. Please start with an empty record without and with the patch, modify 008 using '#' in the advanced editor, save it and look at the data to see the effect. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38895 --- Comment #6 from Janusz Kaczmarek <januszop@gmail.com> --- (In reply to Jonathan Druart from comment #4)
After the patch: Editor: 008 250123b |||| ||| |||| 00| 0 eng d The # disappeared here. Marc defailt: @ 250123b ||||#||| |||| 00| 0 eng d
BTW there may be another bug to fill that the advanced editor does not show (and maybe highlights) the illegal values that possibly may be present in 008 (the 'traditional' 008 plugin highlights it in yellow): here '#', but to give more obvious example: 008/29 = '2' (not legal at this position). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38895 --- Comment #7 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- + if ( end - start > 1 ) { What is the purpose of this test? Should it be >0 btw ? end index is not inclusive in the substring call What about other places in the script where we do a similar call? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38895 --- Comment #8 from Janusz Kaczmarek <januszop@gmail.com> --- (In reply to Marcel de Rooy from comment #7)
+ if ( end - start > 1 ) {
What is the purpose of this test? Should it be >0 btw ? end index is not inclusive in the substring call
What about other places in the script where we do a similar call?
This is to not delete spaces from one-character-long positions in 008. Without this change activating select drop-down looses the focus, because the value becomes an empty string instead of remaining ' '. But for longer input fields, where end - start > 1 (e.g. like 008/7-10, 008/11-14 for dates) we want not to have spaces, but have the cursor placed at the beginning of the input field. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38895 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38895 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #176582|0 |1 is obsolete| | --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 177373 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=177373&action=edit Bug 38895: In advanced editor, the fixed data helpers put '#' instead of space in record content When editing a bibliographic record in advanced editor, there are helpers for fixed data coded fields (like 008). Like in the standard editor, empty value (space) is represented by a hash sign. But unlike in the standard editor, the hash sign is not converted into a space but remains as '#' in the saved record. This is obviously wrong. Test plan: ========== 1. Ensure to have EnableAdvancedCatalogingEditor set to 'enable'. 2. Create of edit a record, choosing for one of one-letter codes an empty value (represented by '#' in the helper). 3. Save the record, control in 'MARC preview' that you got a hash sign in the 008 field instead of a space. 4. Apply the patch ; restart all. 5. Open a record in advanced editor, refresh the page to reload the java script (Shift+Ctrl+R or another appropriate shortcut). Edit the 008 field again choosing for one of one-letter codes an empty value. 6. Save the record, control in 'MARC preview' that there is a space and not the hash sign. Sponsored-by: Ignatianum University in Cracow Signed-off-by: esther <esther@bywatersolutions.com> 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=38895 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |m.de.rooy@rijksmuseum.nl |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38895 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |25.05.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38895 --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Pushed for 25.05! Well done everyone, thank you! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38895 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to main |Pushed to stable CC| |fridolin.somers@biblibre.co | |m Version(s)|25.05.00 |25.05.00,24.11.08 released in| | --- Comment #11 from Fridolin Somers <fridolin.somers@biblibre.com> --- Pushed to 24.11.x for 24.11.08 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38895 Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Needs documenting --- Comment #12 from Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> --- Not backporting to 22.11.x as it wasn't backported to 24.05.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org