Bug 40585: Check on Biblios->find in addbybiblionumber scripts

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>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 60b1cf95c4)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit 8198f36473)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Marcel de Rooy 2025-08-04 09:48:26 +02:00 committed by Fridolin Somers
parent 38538d2230
commit 13badabaf8
No known key found for this signature in database
GPG Key ID: 9A8E73E2A8B96537
2 changed files with 2 additions and 2 deletions

View File

@ -189,7 +189,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,
{ biblionumber => $biblionumber,

View File

@ -188,7 +188,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,
{ biblionumber => $biblionumber,