my $action = $self->cgi->param('action') || '';
my ($cache_key, $list) = $self->fetch_mylist;
+
+ if ((scalar(@rec_ids) == 0) ||
+ ($self->cgi->param('entire_list') && scalar(@$list) == 0)) {
+ my $url = $self->ctx->{referer};
+ $url .= ($url =~ /\?/ ? '&' : '?') . 'cart_none_selected=1';
+ return $self->generic_redirect($url);
+ }
+
if ($action eq 'place_hold') {
if ($self->cgi->param('entire_list')) {
@rec_ids = @$list;
</form>
</div>
<form action="[% mkurl(ctx.opac_root _ '/mylist/move') %]" method="post">
- <input type="hidden" name="redirect_to" value="[% ctx.unparsed_uri | html %]" />
+ <input type="hidden" name="redirect_to" value="[% mkurl('', {}, ['cart_none_selected']) %]" />
<div class="bbag-action" style="clear:both;">
<select name="action">
<option>[% l('-- Actions for these items --') %]</option>
</select>
[%- INCLUDE "opac/parts/preserve_params.tt2"; %]
<input class="opac-button" type="submit" value="[% l('Go') %]" />
+ [% IF CGI.param('cart_none_selected') %]
+ <span class="error">[% l('No items were selected') %]</span>
+ [% END %]
</div>
<div class="bbag-content">
<table class="bookbag-specific table_no_cell_pad table_no_border_space table_no_border">
# some standing, hardcoded parameters to always clear
# because they're used for specific, transitory purposes
cgi.delete('move_cart_by_default');
+ cgi.delete('cart_none_selected');
# x and y are artifacts of using <input type="image" /> tags
# instead of true submit buttons, and their values are never used.