Bugzilla – Attachment 166611 Details for
Bug 36834
(Bug 29697 follow-up) Koha explodes when trying to open in Labeled MARC view a bibliographic record with an invalid biblionumber
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36834: (Bug 29697 follow-up) Koha explodes when trying to open in Labeled MARC view a bibliographic record with an invalid biblionumber
Bug-36834-Bug-29697-follow-up-Koha-explodes-when-t.patch (text/plain), 2.14 KB, created by
Janusz Kaczmarek
on 2024-05-11 08:54:23 UTC
(
hide
)
Description:
Bug 36834: (Bug 29697 follow-up) Koha explodes when trying to open in Labeled MARC view a bibliographic record with an invalid biblionumber
Filename:
MIME Type:
Creator:
Janusz Kaczmarek
Created:
2024-05-11 08:54:23 UTC
Size:
2.14 KB
patch
obsolete
>From ad37c2e428a82920275474147b6079486f587274 Mon Sep 17 00:00:00 2001 >From: Janusz Kaczmarek <januszop@gmail.com> >Date: Sat, 11 May 2024 08:41:04 +0000 >Subject: [PATCH] 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)". >--- > catalogue/labeledMARCdetail.pl | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/catalogue/labeledMARCdetail.pl b/catalogue/labeledMARCdetail.pl >index 86525162f4..ad8727b0f2 100755 >--- a/catalogue/labeledMARCdetail.pl >+++ b/catalogue/labeledMARCdetail.pl >@@ -56,8 +56,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > ); > > my $biblio_object = Koha::Biblios->find( $biblionumber ); # FIXME Should replace $biblio >-my $record = $biblio_object->metadata->record; >-if ( not defined $record ) { >+unless ($biblio_object) { > # biblionumber invalid -> report and exit > $template->param( unknownbiblionumber => 1, > biblionumber => $biblionumber >@@ -66,6 +65,7 @@ if ( not defined $record ) { > exit; > } > >+my $record = $biblio_object->metadata->record; > my $tagslib = GetMarcStructure(1,$frameworkcode); > my $biblio = GetBiblioData($biblionumber); > >-- >2.39.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36834
:
166611
|
166612
|
166749