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>
This commit is contained in:
Marcel de Rooy 2025-08-04 09:48:26 +02:00 committed by Paul Derscheid
parent ae67fcfe40
commit 8198f36473
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
2 changed files with 2 additions and 2 deletions

View File

@ -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,
{

View File

@ -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,
{