Bugzilla – Attachment 185080 Details for
Bug 40585
Prevent crash on biblionumber in addbybiblionumber.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40585: Check on Biblios->find in addbybiblionumber scripts
Bug-40585-Check-on-Biblios-find-in-addbybiblionumb.patch (text/plain), 1.99 KB, created by
Marcel de Rooy
on 2025-08-04 08:08:32 UTC
(
hide
)
Description:
Bug 40585: Check on Biblios->find in addbybiblionumber scripts
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2025-08-04 08:08:32 UTC
Size:
1.99 KB
patch
obsolete
>From 0108d4b4a87a3cb054b7e14b7ee0a658de275d72 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 4 Aug 2025 09:48:26 +0200 >Subject: [PATCH] Bug 40585: Check on Biblios->find in addbybiblionumber > scripts >Content-Type: text/plain; charset=utf-8 > >Just jumping to the next biblionumber (and adding found biblio recs) is >more user friendly than crashing without any further clarification to >the user. >Note that this should be a rare exception when the URL is not manipulated >(someone deleting a biblio while another wants to add it to a list). >For another bug: The template is not designed to handle the situation that >no biblio is found at all. > >Test plan: >Select a biblio to add to a list and add a not-existent biblionumber >to the URL. >Without this patch, that URL will crash. With this patch, it will >silently ignore a wrong biblionumber. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > opac/opac-addbybiblionumber.pl | 2 +- > virtualshelves/addbybiblionumber.pl | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > >diff --git a/opac/opac-addbybiblionumber.pl b/opac/opac-addbybiblionumber.pl >index 23c03ab0de..a00ddba8ac 100755 >--- a/opac/opac-addbybiblionumber.pl >+++ b/opac/opac-addbybiblionumber.pl >@@ -201,7 +201,7 @@ if ( $op && $op !~ /^cud-/ ) { > > if ($authorized) { > for my $biblionumber (@biblionumbers) { >- my $biblio = Koha::Biblios->find($biblionumber); >+ my $biblio = Koha::Biblios->find($biblionumber) or next; > push( > @biblios, > { >diff --git a/virtualshelves/addbybiblionumber.pl b/virtualshelves/addbybiblionumber.pl >index 1d77b41187..cfbde23b68 100755 >--- a/virtualshelves/addbybiblionumber.pl >+++ b/virtualshelves/addbybiblionumber.pl >@@ -192,7 +192,7 @@ if ( $op && $op !~ /^cud-/ ) { > > my @biblios; > for my $biblionumber (@biblionumbers) { >- my $biblio = Koha::Biblios->find($biblionumber); >+ my $biblio = Koha::Biblios->find($biblionumber) or next; > push( > @biblios, > { >-- >2.39.5
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 40585
:
185080
|
185439
|
185440