[Bug 33335] New: MARC overlay rules broken because of "categorycode.categorycode " which contains "-"
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33335 Bug ID: 33335 Summary: MARC overlay rules broken because of "categorycode.categorycode " which contains "-" Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: System Administration Assignee: koha-bugs@lists.koha-community.org Reporter: marius.mandrescu@inlibro.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com Created attachment 148696 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148696&action=edit the page half loaded The "MARC overlay rules" page becomes inaccessible if in the DB there is in the "categories" table a "categorycode" which contains a "-". This happens because of the javascript function on the page "marc-overlay-rules.tt" line 469. The problem that is caused is the "SyntaxError: missing : after property id". Plan test: 1- Go to Administration->Patron categories 2- Make sure you don't already have a patron categories that contains a "-" 3- Go to Administration->Record matching rules 4- Everything should be displayed as it does 5- Return to Patron categories 6- Add a new category In the category code put a "-" and save 7- Return to Record matching rules The page should be half loaded as in the photo The solution should not prevent the user from putting "-" in the category code but the Record matching rules accept the category code with "-". -- 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=33335 Marius <marius.mandrescu@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|NEW |Needs Signoff -- 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=33335 --- Comment #1 from Marius <marius.mandrescu@inlibro.com> --- Created attachment 148841 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148841&action=edit Bug 33335: fix marc overlay rules accept '-' -- 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=33335 --- Comment #2 from Marius <marius.mandrescu@inlibro.com> --- I add a patch to solve this problem. The patch has to make sure that even if there is a categorycode with "-" it will be able to display it. testing plan: 1- Go to Administration->Patron categories 2- Make sure you don't already have a boss categories that contains a "-" 3- Go to Administration->Record matching rules 4- Everything should be displayed as it does 5- Return to Patron categories 6- Add a new category In the category code put a "-" and save 7- Return to Record matching rules The page should be half loaded as in the photo 8- Apply this patch 9- Repeat the step 7, everything should work on the Record matching rules page -- 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=33335 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- 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=33335 --- Comment #3 from David Nind <david@davidnind.com> --- Created attachment 149253 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=149253&action=edit Bug 33335: Fix JavaScript error on the MARC overlay rules page The "MARC overlay rules" page doesn't display or work correctly if a patron category code contains a "-". This happens because of the JavaScript function in "marc-overlay-rules.tt" line 469. This causes an error "Uncaught SyntaxError: missing : after property id". Test plan: 1. Go to Administration > Patron categories. 2. Make sure you don't have a patron category code that contains a "-". 3. Go to Administration > Record overlay rules. 4. The table should display correctly, and you can add, edit and delete rules. 5. Return to Patron categories. 6. Add a new patron category with a "-" in the patron category code. 7. Return to Record overlay rules page: => The page doesn't display and load correctly (see the attached image) - the normal DataTables header and footer aren't displayed, and you can't add, edit or delete overlay rules. => If you turn on web developer tools, an error is displayed in the console: "Uncaught SyntaxError: missing : after property id". 8. Apply the patch. 9. Repeat the step 7, the Record overlay rules page should now display correctly and you should be able to add, edit and delete rules. 10. Sign off. Signed-off-by: David Nind <david@davidnind.com> -- 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=33335 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Attachment #148841|0 |1 is obsolete| | --- Comment #4 from David Nind <david@davidnind.com> --- Comment on attachment 148841 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=148841 Bug 33335: fix marc overlay rules accept '-' I have edited the commit message to include the test plan - feel free to update if I haven't covered it correctly. Normally, the commit message should include the test plan - see https://wiki.koha-community.org/wiki/Commit_messages Also, I'm not sure what I did when I signed off, for some reason the original patch wasn't obsoleted. -- 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=33335 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |marius.mandrescu@inlibro.co |ity.org |m --- Comment #5 from David Nind <david@davidnind.com> --- I have changed the assignee to Marius. -- 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=33335 --- Comment #6 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 150521 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=150521&action=edit Bug 33335: Use To.json to serialize -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33335 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com --- Comment #7 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Why did you remove '*'? Also the indentation is not preserved. Attached a patch, feel free to drop it if you disagree with it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33335 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ruchi.agarwal@avidreaders.i | |n --- Comment #8 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- *** Bug 33449 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33335 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl Status|Signed Off |Failed QA --- Comment #9 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Two things: As already commented, we lost the * => * now. Please add it back. And the To.JSON approach does not guarantee a correct sort order which we did have. If you add the *,* in js you will probably loose the sort order which you could not lean on anyway. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33335 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #150521|0 |1 is obsolete| | --- Comment #10 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 151116 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=151116&action=edit Bug 33335: Use To.json to serialize -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33335 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33335 --- Comment #11 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- My last try here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33335 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=33335 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #149253|0 |1 is obsolete| | --- Comment #12 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 151119 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=151119&action=edit Bug 33335: Fix JavaScript error on the MARC overlay rules page The "MARC overlay rules" page doesn't display or work correctly if a patron category code contains a "-". This happens because of the JavaScript function in "marc-overlay-rules.tt" line 469. This causes an error "Uncaught SyntaxError: missing : after property id". Test plan: 1. Go to Administration > Patron categories. 2. Make sure you don't have a patron category code that contains a "-". 3. Go to Administration > Record overlay rules. 4. The table should display correctly, and you can add, edit and delete rules. 5. Return to Patron categories. 6. Add a new patron category with a "-" in the patron category code. 7. Return to Record overlay rules page: => The page doesn't display and load correctly (see the attached image) - the normal DataTables header and footer aren't displayed, and you can't add, edit or delete overlay rules. => If you turn on web developer tools, an error is displayed in the console: "Uncaught SyntaxError: missing : after property id". 8. Apply the patch. 9. Repeat the step 7, the Record overlay rules page should now display correctly and you should be able to add, edit and delete rules. 10. Sign off. Signed-off-by: David Nind <david@davidnind.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=33335 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #151116|0 |1 is obsolete| | --- Comment #13 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 151120 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=151120&action=edit Bug 33335: Use To.json to serialize 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=33335 --- Comment #14 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 151121 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=151121&action=edit Bug 33335: (QA follow-up) Polishing and comments Just send the codes and descriptions only to client. Adding a few comments to the reduce construction. 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=33335 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=33335 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |23.05.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=33335 --- Comment #15 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.05. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33335 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|23.05.00 |23.05.00,22.11.06 released in| | Status|Pushed to master |Pushed to stable -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33335 --- Comment #16 from Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> --- Nice work everyone! Pushed to stable for 22.11.x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33335 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |Pushed to oldstable Version(s)|23.05.00,22.11.06 |23.05.00,22.11.06,22.05.14 released in| | CC| |lucas@bywatersolutions.com --- Comment #17 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 22.05.x for upcoming 22.05.14 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33335 Danyon Sewell <danyonsewell@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |danyonsewell@catalyst.net.n | |z Resolution|--- |FIXED Status|Pushed to oldstable |RESOLVED --- Comment #18 from Danyon Sewell <danyonsewell@catalyst.net.nz> --- Not backporting for 21.11.x -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org