After changes made in catalogue/labeledMARCdetail.pl with the bug 29697 when trying to open the Labeled MARC view with biblionumber=<invalid_number> (e.g. a deleted biblionumber) Koha explodes with a message << Can't call method "metadata" on an undefined value at /kohadevbox/koha/catalogue/labeledMARCdetail.pl line 59 >>
Created attachment 166611 [details] [review] Bug 36834: (Bug 29697 follow-up) Koha explodes when trying to open in Labeled MARC view a bibliographic record with an invalid biblionumber After changes made in catalogue/labeledMARCdetail.pl with the bug 29697 when trying to open the Labeled MARC view with biblionumber=<invalid_number> (e.g. a deleted biblionumber) Koha explodes with a message << Can't call method "metadata" on an undefined value at /kohadevbox/koha/catalogue/labeledMARCdetail.pl line 59 >> Test plan: ========== 1. Activate the viewLabeledMARC syspref. 2. Try to open a biblio record in Labeled MARC view, giving as a biblionumber (in URL) a non-existing biblionumber, e.g. in ktd, with standard ktd test data: http://your_ktd:8081/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=1234567 Koha should explode with the message: Can't call method "metadata" on an undefined value at /kohadevbox/koha/catalogue/labeledMARCdetail.pl line 59 3. Apply the patch; restart_all. 4. Repeat p. 2. You should get a regular page with the info "The record you requested does not exist (1234567)".
Created attachment 166612 [details] [review] Bug 36834: (Bug 29697 follow-up) Koha explodes when trying to open in Labeled MARC view a bibliographic record with an invalid biblionumber After changes made in catalogue/labeledMARCdetail.pl with the bug 29697 when trying to open the Labeled MARC view with biblionumber=<invalid_number> (e.g. a deleted biblionumber) Koha explodes with a message << Can't call method "metadata" on an undefined value at /kohadevbox/koha/catalogue/labeledMARCdetail.pl line 59 >> Test plan: ========== 1. Activate the viewLabeledMARC syspref. 2. Try to open a biblio record in Labeled MARC view, giving as a biblionumber (in URL) a non-existing biblionumber, e.g. in ktd, with standard ktd test data: http://your_ktd:8081/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=1234567 Koha should explode with the message: Can't call method "metadata" on an undefined value at /kohadevbox/koha/catalogue/labeledMARCdetail.pl line 59 3. Apply the patch; restart_all. 4. Repeat p. 2. You should get a regular page with the info "The record you requested does not exist (1234567)". Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Created attachment 166749 [details] [review] Bug 36834: (Bug 29697 follow-up) Koha explodes when trying to open in Labeled MARC view a bibliographic record with an invalid biblionumber After changes made in catalogue/labeledMARCdetail.pl with the bug 29697 when trying to open the Labeled MARC view with biblionumber=<invalid_number> (e.g. a deleted biblionumber) Koha explodes with a message << Can't call method "metadata" on an undefined value at /kohadevbox/koha/catalogue/labeledMARCdetail.pl line 59 >> Test plan: ========== 1. Activate the viewLabeledMARC syspref. 2. Try to open a biblio record in Labeled MARC view, giving as a biblionumber (in URL) a non-existing biblionumber, e.g. in ktd, with standard ktd test data: http://your_ktd:8081/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=1234567 Koha should explode with the message: Can't call method "metadata" on an undefined value at /kohadevbox/koha/catalogue/labeledMARCdetail.pl line 59 3. Apply the patch; restart_all. 4. Repeat p. 2. You should get a regular page with the info "The record you requested does not exist (1234567)". Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Thanks for the fix here. Passing QA
Why don't you reuse the same pattern as other catalogue files? catalogue/MARCdetail.pl has 94 $record = $biblio_object->metadata->record({ embed_items => 1 }) if $biblio_object;
and catalogue/ISBDdetail.pl has yet another version...
Hi, can you please reply to Jonathan's questions?
(In reply to Katrin Fischer from comment #7) > Hi, can you please reply to Jonathan's questions? I've seen the comment but, sincerely, I don't know what to answer. I just fixed -- by simple means, following the Perl TMTOWTDI rule -- what had been broken by Bug 29697. Shall I understand the question as a suggestion to rewrite the patch? I can do it, no problem, just tell me. But the intention behind the Jonathan's question is not clear for me.
I think this patch can go as it. But it would be nice to have a follow-up bug to standardise the different controller using similar code.
No string changes, related to another bug already in, decided to push.
Pushed for 24.05! Well done everyone, thank you!
Pushed to 23.11.x for 23.11.06
Backported to 23.05.x for upcoming 23.05.12