From d04680b914a4482c75b8ba15287bd176cf7e78eb Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 15 Aug 2025 11:16:49 +0000 Subject: [PATCH] Bug 40585: (follow-up) Display error if no records were found --- .../en/modules/virtualshelves/addbybiblionumber.tt | 3 ++- virtualshelves/addbybiblionumber.pl | 13 ++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/addbybiblionumber.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/addbybiblionumber.tt index 8dcaf8b7e56..95c47783641 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/addbybiblionumber.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/addbybiblionumber.tt @@ -13,10 +13,11 @@
[% UNLESS (authorized) %] +

Error adding to list

-

Error adding to list

[% IF (errcode==1) %]

Could not create a new list. Please check the name.

[% END %] [% IF (errcode==2) %]

Sorry, you do not have permission to add items to this list.

[% END %] + [% IF (errcode==3) %]

The titles selected were not found

[% END %]
[% ELSE %] diff --git a/virtualshelves/addbybiblionumber.pl b/virtualshelves/addbybiblionumber.pl index cfbde23b682..36b73b41441 100755 --- a/virtualshelves/addbybiblionumber.pl +++ b/virtualshelves/addbybiblionumber.pl @@ -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, -- 2.39.5