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 1e219f4404..c4a99d8363 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/addbybiblionumber.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/addbybiblionumber.tt
@@ -18,10 +18,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 cfbde23b68..36b73b4144 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,