Bug 40585: (follow-up) Display error if no records were found

Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit b9bf3609d1)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
Owen Leonard 2025-08-15 11:16:49 +00:00 committed by Paul Derscheid
parent 8198f36473
commit 5b92e3ba7f
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
2 changed files with 10 additions and 6 deletions

View File

@ -18,10 +18,11 @@
<body id="lists_addbybiblionumber" class="lists">
<div class="container-fluid">
[% UNLESS (authorized) %]
<h1>Error adding to list</h1>
<div class="alert alert-warning">
<h1>Error adding to list</h1>
[% IF (errcode==1) %]<p>Could not create a new list. Please check the name.</p>[% END %]
[% IF (errcode==2) %]<p>Sorry, you do not have permission to add items to this list.</p>[% END %]
[% IF (errcode==3) %]<p>The titles selected were not found</p>[% END %]
<button class="btn btn-default close_window focus">Close window</button>
</div>
[% ELSE %]

View File

@ -202,13 +202,16 @@ for my $biblionumber (@biblionumbers) {
}
);
}
$template->param(
multiple => ( scalar(@biblios) > 1 ),
total => scalar @biblios,
biblios => \@biblios,
);
if ( scalar(@biblios) < 1 ) {
$errcode = 3;
$authorized = 0; # trigger error screen
}
$template->param(
multiple => ( scalar(@biblios) > 1 ),
total => scalar @biblios,
biblios => \@biblios,
newshelf => $newshelf || 0,
authorized => $authorized,
errcode => $errcode,