Created attachment 148696 [details] 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 "-".
Created attachment 148841 [details] [review] Bug 33335: fix marc overlay rules accept '-'
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
Created attachment 149253 [details] [review] 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>
Comment on attachment 148841 [details] [review] 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.
I have changed the assignee to Marius.
Created attachment 150521 [details] [review] Bug 33335: Use To.json to serialize
Why did you remove '*'? Also the indentation is not preserved. Attached a patch, feel free to drop it if you disagree with it.
*** Bug 33449 has been marked as a duplicate of this bug. ***
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.
Created attachment 151116 [details] [review] Bug 33335: Use To.json to serialize
My last try here.
Created attachment 151119 [details] [review] 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>
Created attachment 151120 [details] [review] Bug 33335: Use To.json to serialize Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 151121 [details] [review] 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>
Pushed to master for 23.05. Nice work everyone, thanks!
Nice work everyone! Pushed to stable for 22.11.x
Backported to 22.05.x for upcoming 22.05.14
Not backporting for 21.11.x