[Bug 25913] New: Internal server error when calling get_coins on record with no title (245) but with 880 linked to 245
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25913 Bug ID: 25913 Summary: Internal server error when calling get_coins on record with no title (245) but with 880 linked to 245 Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Lists Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl In opac search results we call get_coins in an eval so it can load, on other scripts we don't The get_coins routine calls: $title = $record->field('245')->as_string('ab'); With no check that the 245 exists. Simple fix would be to call get_coins in an eval everywhere More comprehensive would be to fall back to 880 field linked ot 245, and then fallback to blank This only affects MARC21 I believe as the UNIMARC implementation gets the field directly without as_string To recreate: 1 - Load attached record or create a record with 880 and no 245 2 - Enable COinSinOpac 3 - Search for record in staff or opac, it loads in results 4 - Add item to a public list, cannot view in opac 5 - Try to view ISBD or MARC tab on staff client, it fails When indexing in ES we convert an 880 to its linked field so the record is searchable, so we could make that a sbroutine -- 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=25913 Heather <heather_hernandez@nps.gov> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |heather_hernandez@nps.gov -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25913 --- Comment #1 from Heather <heather_hernandez@nps.gov> --- Created attachment 106476 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=106476&action=edit A bib record with no 245 and 880 fields from our catalog I'm uploading one of our MARC21 records, exported from OCLC that has no 245 and has the 880 fields in it that might be useful for folks to use in testing. -- 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=25913 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=25913 --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 107563 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=107563&action=edit Bug 25913: Prevent get_coins to crash if record does not have title If a bibliographic record does not have a title, get_coins will crash with Can't call method "as_string" on an undefined value at /kohadevbox/koha/Koha/Biblio.pm line 645 Koha::Biblio::get_coins('Koha::Biblio=HASH(0x5558f91bb740)') called at /kohadevbox/koha/catalogue/ISBDdetail.pl line 144 We can handle that situation easily by checking the existence of the title field. Test plan: 1. Create a record without 245 2. Enable COinSinOpac 4. Go to the ISBD detail view => It must not fail with this patch applied -- 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=25913 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |jonathan.druart@bugs.koha-c |ity.org |ommunity.org CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Nick Clemens from comment #0)
In opac search results we call get_coins in an eval so it can load, on other scripts we don't
We surround it by an eval in detail.pl to deal with encoding problems, what we don't on other views. I think this patch deals correctly with the problem you reported. -- 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=25913 --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Nick, don't forget to copy the error message when a 500 is reported :) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25913 --- Comment #5 from Heather <heather_hernandez@nps.gov> --- I'm going to sign off--everything worked according to the test plan when I tried to sign off, and the ISBD view didn't fail, but it also didn't include any data from the 880 10 $6 245-00, i.e.: 880 1 0 _6245-00 _aSS President Coolidge = [Президент Кулидж] : So the "Normal" view looks like this: SS President Coolidge = [Президент Кулидж] : Под водой с Вадим Малыш / By: Malysh, Vadim [filmmaker.] ...etc. But the ISBD view like this: Malysh, Vadim, - 1 videodisc (11:41 min.) : sound, color with black and white sequences ; 4 3/4 in. TEST RECORD.--h2 Title from disc. Narrator, Nikita Puryzhinsky. DVD. In Russian with English subtitles. Subjects--Corporate Names: President Coolidge (Steamship) Subjects--Topical Terms: Deep diving--Vanuatu--Espíritu Santo Island. Shipwrecks--Vanuatu--Espíritu Santo Island. LC Class. No.: VK1255.P703 / M35 2009 So perhaps getting that 880 10 $6 245-00 $a data into the ISBD view should be a separate bug? Because the ISBD view isn't very useful without the title!:) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25913 ByWater Sandboxes <bws.sandboxes@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #107563|0 |1 is obsolete| | --- Comment #6 from ByWater Sandboxes <bws.sandboxes@gmail.com> --- Created attachment 110941 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=110941&action=edit Bug 25913: Prevent get_coins to crash if record does not have title If a bibliographic record does not have a title, get_coins will crash with Can't call method "as_string" on an undefined value at /kohadevbox/koha/Koha/Biblio.pm line 645 Koha::Biblio::get_coins('Koha::Biblio=HASH(0x5558f91bb740)') called at /kohadevbox/koha/catalogue/ISBDdetail.pl line 144 We can handle that situation easily by checking the existence of the title field. Test plan: 1. Create a record without 245 2. Enable COinSinOpac 4. Go to the ISBD detail view => It must not fail with this patch applied Signed-off-by: Heather Hernandez <heather_hernandez@nps.gov> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25913 Heather <heather_hernandez@nps.gov> 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=25913 Joonas Kylmälä <joonas.kylmala@helsinki.fi> 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=25913 Joonas Kylmälä <joonas.kylmala@helsinki.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #110941|0 |1 is obsolete| | --- Comment #7 from Joonas Kylmälä <joonas.kylmala@helsinki.fi> --- Created attachment 111153 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111153&action=edit Bug 25913: Prevent get_coins to crash if record does not have title If a bibliographic record does not have a title, get_coins will crash with Can't call method "as_string" on an undefined value at /kohadevbox/koha/Koha/Biblio.pm line 645 Koha::Biblio::get_coins('Koha::Biblio=HASH(0x5558f91bb740)') called at /kohadevbox/koha/catalogue/ISBDdetail.pl line 144 We can handle that situation easily by checking the existence of the title field. Test plan: 1. Create a record without 245 2. Enable COinSinOpac 4. Go to the ISBD detail view => It must not fail with this patch applied Signed-off-by: Heather Hernandez <heather_hernandez@nps.gov> Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25913 --- Comment #8 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 111366 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=111366&action=edit Bug 25913: Get the correct return of AddBiblio We need the parenthesis to get the biblionumber and not the biblioitemnumber, in case there is a discrepancy. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25913 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |20.11.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=25913 --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Pushed to master for 20.11, thanks to everybody involved! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25913 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Status|Pushed to master |Pushed to stable Version(s)|20.11.00 |20.11.00, 20.05.05 released in| | --- Comment #10 from Lucas Gass <lucas@bywatersolutions.com> --- backported to 20.05.x for 20.05.05 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25913 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|20.11.00, 20.05.05 |20.11.00, 20.05.05, released in| |19.11.11 CC| |aleisha@catalyst.net.nz Status|Pushed to stable |Pushed to oldstable --- Comment #11 from Aleisha Amohia <aleisha@catalyst.net.nz> --- backported to 19.11.x for 19.11.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25913 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net --- Comment #12 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Not backported to oldoldstable (19.05.x). Feel free to ask if it's needed. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org