See bug 29690 - find/create a record with invalid marc Notes tab shows but is empty
That's expected, there is a warning "the view may be degraded". This is not a bug IMO.
Created attachment 131917 [details] [review] Bug 30009: If no record set MARCNOTES undef, rather than empty array Currently we pass an empty array if there is no marc record - this is read as 'true' by template toolkit, and the desciptions tab is loaded This patch just sets the variable as undef which is false To test: 1 - Find or create an invalid marc record 2 - View in staff client 3 - Note tab Descriptions(1) has no content 4 - Apply patch, reload 5 - No empty tab
(In reply to Jonathan Druart from comment #1) > That's expected, there is a warning "the view may be degraded". > This is not a bug IMO. Sure, but problem is what we are passing, we should instead pass nothing
How does one create an invalid MARC record?
(In reply to Owen Leonard from comment #4) > How does one create an invalid MARC record? Record 369 in KTD's database has an invalid MARC::Record. Otherwise you can edit a biblio reuse step 3 from Nick's test plan from bug 30008: 3 - In the 520 notes field, add an ASCII escape character (27 decimal, 1b hex) On ubuntu Ctrl+Shift+u, then 1b, enter The character for copy/paste is:
(In reply to Jonathan Druart from comment #5) > The character for copy/paste is: It got removed.
Created attachment 135008 [details] [review] Bug 30009: If no record set MARCNOTES undef, rather than empty array Currently we pass an empty array if there is no marc record - this is read as 'true' by template toolkit, and the desciptions tab is loaded This patch just sets the variable as undef which is false To test: 1 - Find or create an invalid marc record 2 - View in staff client 3 - Note tab Descriptions(1) has no content 4 - Apply patch, reload 5 - No empty tab Signed-off-by: David Nind <david@davidnind.com>
I've signed off as things work as per the test plan when using KTD and record 369 in the test data. Note that the 520 filed for record 369 has a valid value, and that it is other missing tags making it invalid (as far as I can see). It displays correctly once the patch is applied. Also, if you try to view the record in the OPAC you get an error trace: Invalid data, cannot decode metadata object (biblio_metadata.id=368, biblionumber=369, format=marcxml, schema=MARC21, decoding_error=':8: parser error : PCDATA invalid Char value 31 <controlfield tag="001">00aD000015937</controlfield> ^ :9: parser error : PCDATA invalid Char value 31 <controlfield tag="004">00satmrnu0</controlfield> ^ :9: parser error : PCDATA invalid Char value 31 <controlfield tag="004">00satmrnu0</controlfield> ^ :9: parser error : PCDATA invalid Char value 31 <controlfield tag="004">00satmrnu0</controlfield> ^ :9: parser error : PCDATA invalid Char value 31 <controlfield tag="004">00satmrnu0</controlfield> ^ :10: parser error : PCDATA invalid Char value 31 <controlfield tag="008">00ar19881981bdkldan</controlfield> ^ :10: parser error : PCDATA invalid Char value 31 <controlfield tag="008">00ar19881981bdkldan</controlfield> ^ :10: parser error : PCDATA invalid Char value 31 <controlfield tag="008">00ar19881981bdkldan</controlfield> ^') at /usr/share/perl5/Exception/Class/Base.pm line 88 in Exception::Class::Base::throw at /usr/share/perl5/Exception/Class/Base.pm line 88
No assignee?
(In reply to Nick Clemens from comment #2) > Currently we pass an empty array if there is no marc record - this > is read as 'true' by template toolkit, and the desciptions tab is loaded > > This patch just sets the variable as undef which is false Just being more precise: We pass an empty list. This is not read as true, as the above commit message tells. But it creates the odd arguments hash where the next key shifts into the position of the MARCNOTES value.
Created attachment 135101 [details] [review] Bug 30009: Do not set MARCNOTES to empty list in list context AMENDED: We should not pass an empty list here, but just undef in order to prevent creating a shift of elements in the hash. To test: 1 - Find or create an invalid marc record 2 - View in staff client 3 - Note tab Descriptions(1) has no content 4 - Apply patch, reload 5 - No empty tab Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Pushed to master for 22.05, thanks to everybody involved [U+1F984]