I wonder if this is a side effect on the recent work on 'invalid metadata'. * Activate * Make sure you open any record with the advanced editor * Try to open: Perl best practices / Damian Conway. * You get stuck in loading * Javascript error shows "Invalid-metadata" on top of the MARC record, causing a syntax error
git bisect says 8dc2152e2f32b79abfe5f5531ddc225601498116 is the first bad commit commit 8dc2152e2f32b79abfe5f5531ddc225601498116 Author: Nick Clemens <nick@bywatersolutions.com> Date: Tue Oct 17 17:06:22 2023 +0000 Bug 34014: Add support for advanced cataloging editor And amusingly, you can edit at least one sample record, 369, the one with encoding errors. You just can't edit any record which does not have encoding errors.
Created attachment 158241 [details] [review] Bug 35181: Don't pass undef to header It seems passing an undef value causes the headers to be malformed. To test: 1 - Visit http://localhost:8081/cgi-bin/koha/svc/bib/303 2 - Note 'Invalid-metadata' at top of page, as well as other headers 3 - Apply patch, restart all 4 - Visit http://localhost:8081/cgi-bin/koha/svc/bib/303 5 - Page should now appear as xml 6 - Edit record 303, or any record with valid metadata in the advanced cataloging editor 7 - Confirm there is no error or alert 8 - Edit record 369 in the advanced cataloging editor 9 - Confirm there is an alert
After the patch, if I edit 303 (Pawn structure chess), I can: 1. Edit and save in the normal editor, even though the 003 tag is mandatory (I changed the title $245$a) 2. Get an error in the advanced editor: sort of pop up alert "Record structure invalid, cannot save", then "Missing mandatory tag: 003" at the top of the advanced editor. 3. If I edit "Programming perl" (262), the same thing occurs. Changed the priority of the bug to major.
(In reply to David Nind from comment #3) > After the patch, if I edit 303 (Pawn structure chess), I can: > > 1. Edit and save in the normal editor, even though the 003 tag is mandatory > (I changed the title $245$a) > > 2. Get an error in the advanced editor: sort of pop up alert "Record > structure invalid, cannot save", then "Missing mandatory tag: 003" at the > top of the advanced editor. > > 3. If I edit "Programming perl" (262), the same thing occurs. > > Changed the priority of the bug to major. That all makes sense - though the basic editor probably should enforce fields. If you add the 003 it saves normally? Or if it gives other errors, solve them too. Then all is good for SO
The book 303 is in the Audio Cassettes, CDs framework, which has 003 mandatory but not visible in the basic editor. That should probably be flagged in the framework test, but what the basic editor should do in that case is... unclear, but certainly not this bug. But the patch left a stray +# print $query->header( -type => 'text/xml', -charset => 'utf-8' ); in svc/bib, which is going to get you in trouble.
Created attachment 158276 [details] [review] Bug 35181: Don't pass undef to header It seems passing an undef value causes the headers to be malformed. To test: 1 - Visit http://localhost:8081/cgi-bin/koha/svc/bib/303 2 - Note 'Invalid-metadata' at top of page, as well as other headers 3 - Apply patch, restart all 4 - Visit http://localhost:8081/cgi-bin/koha/svc/bib/303 5 - Page should now appear as xml 6 - Edit record 303, or any record with valid metadata in the advanced cataloging editor 7 - Confirm there is no error or alert 8 - Edit record 369 in the advanced cataloging editor 9 - Confirm there is an alert
Created attachment 158284 [details] [review] Bug 35181: Don't pass undef to header It seems passing an undef value causes the headers to be malformed. To test: 1 - Visit http://localhost:8081/cgi-bin/koha/svc/bib/303 2 - Note 'Invalid-metadata' at top of page, as well as other headers 3 - Apply patch, restart all 4 - Visit http://localhost:8081/cgi-bin/koha/svc/bib/303 5 - Page should now appear as xml 6 - Edit record 303, or any record with valid metadata in the advanced cataloging editor 7 - Confirm there is no error or alert 8 - Edit record 369 in the advanced cataloging editor 9 - Confirm there is an alert Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org>
Created attachment 158376 [details] [review] Bug 35181: Don't pass undef to header It seems passing an undef value causes the headers to be malformed. To test: 1 - Visit http://localhost:8081/cgi-bin/koha/svc/bib/303 2 - Note 'Invalid-metadata' at top of page, as well as other headers 3 - Apply patch, restart all 4 - Visit http://localhost:8081/cgi-bin/koha/svc/bib/303 5 - Page should now appear as xml 6 - Edit record 303, or any record with valid metadata in the advanced cataloging editor 7 - Confirm there is no error or alert 8 - Edit record 369 in the advanced cataloging editor 9 - Confirm there is an alert Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Pushed to master for 23.11. Nice work everyone, thanks!
Pushed to 23.05.x for 23.05.06
*** Bug 35416 has been marked as a duplicate of this bug. ***
*** Bug 35443 has been marked as a duplicate of this bug. ***