Bugzilla – Attachment 166749 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.25 KB, created by
Martin Renvoize (ashimema)
on 2024-05-15 06:50:02 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:
Martin Renvoize (ashimema)
Created:
2024-05-15 06:50:02 UTC
Size:
2.25 KB
patch
obsolete
>From d86fa04662a7c8aa12f519f5d5266c0e25fa5774 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)". > >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > catalogue/labeledMARCdetail.pl | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/catalogue/labeledMARCdetail.pl b/catalogue/labeledMARCdetail.pl >index 86525162f46..ad8727b0f2e 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.45.0
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