Summary: | Internal server error when calling get_coins on record with no title (245) but with 880 linked to 245 | ||
---|---|---|---|
Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
Component: | Lists | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | aleisha, flyingendpaper, jonathan.druart, lucas, m.de.rooy, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
20.11.00, 20.05.05, 19.11.11
|
|
Circulation function: | |||
Attachments: |
A bib record with no 245 and 880 fields from our catalog
Bug 25913: Prevent get_coins to crash if record does not have title Bug 25913: Prevent get_coins to crash if record does not have title Bug 25913: Prevent get_coins to crash if record does not have title Bug 25913: Get the correct return of AddBiblio |
Description
Nick Clemens (kidclamp)
2020-07-02 12:01:15 UTC
Created attachment 106476 [details]
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.
Created attachment 107563 [details] [review] 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 (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. Nick, don't forget to copy the error message when a 500 is reported :) 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!:) Created attachment 110941 [details] [review] 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> Created attachment 111153 [details] [review] 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> Created attachment 111366 [details] [review] 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. Pushed to master for 20.11, thanks to everybody involved! backported to 20.05.x for 20.05.05 backported to 19.11.x for 19.11.11 Not backported to oldoldstable (19.05.x). Feel free to ask if it's needed. |