From ae819fce4cfc12e2e04f1b449c47466d5b3cefab Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Mon, 20 Aug 2018 07:30:45 +0300 Subject: [PATCH] Bug 21248: Fix COinS carp in MARC details page on unknown record Looking up a nonexistent record in the MARC details -page causes the COinS to carp. The fix is trivial, just move the COinS call couple lines, after the record existence check. TEST PLAN --------- 1) reset_all for kohadevbox 2) log in to staff client - admin/admin 3) search catalogue for green 4) tweak the top URL to have a bad biblionumber (eg. 9999) 5) cat /var/log/koha/kohadev/plack-err.log -- floody! with errors. 6) echo | sudo tee /var/log/koha/kohadev/plack-err.log 7) restart_all 8) repeat steps 2 through 5. -- just nice starting messages, not floody. 9) run koha qa test tools Signed-off-by: Mark Tompsett Signed-off-by: Marcel de Rooy Signed-off-by: Nick Clemens (cherry picked from commit 030047da428521c248868e3ee5d655afd3bed05b) Signed-off-by: Martin Renvoize (cherry picked from commit 7fe692bf0ec4dd6744c81c068c400927ccc0c54d) Signed-off-by: Fridolin Somers --- catalogue/MARCdetail.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/catalogue/MARCdetail.pl b/catalogue/MARCdetail.pl index 6474f3e1fa..7a5d951dfe 100755 --- a/catalogue/MARCdetail.pl +++ b/catalogue/MARCdetail.pl @@ -91,7 +91,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my $record = GetMarcBiblio({ biblionumber => $biblionumber, embed_items => 1 }); -$template->param( ocoins => GetCOinSBiblio($record) ); if ( not defined $record ) { # biblionumber invalid -> report and exit @@ -102,6 +101,8 @@ if ( not defined $record ) { exit; } +$template->param( ocoins => GetCOinSBiblio($record) ); + my $biblio_object = Koha::Biblios->find( $biblionumber ); # FIXME Should replace $biblio my $tagslib = &GetMarcStructure(1,$frameworkcode); my $biblio = GetBiblioData($biblionumber); -- 2.39.5