$query .= " $1($term)" if length $term;
}
- # sort is treated specially, even though it's actually a filter
- if ($cgi->param('sort')) {
- $query =~ s/sort\([^\)]*\)//g; # override existing sort(). no stacking.
- my ($axis, $desc) = split /\./, $cgi->param('sort');
- $query .= " sort($axis)";
- if ($desc and not $query =~ /\#descending/) {
- $query .= '#descending';
- } elsif (not $desc) {
- $query =~ s/\#descending//;
- }
- }
-
if ($cgi->param("bookbag")) {
$query .= " container(bre,bookbag," . int($cgi->param("bookbag")) . ")";
}
}
}
+ # ---------------------------------------------------------------------
+ # Nothing below here constitutes a query by itself. If the query value
+ # is still empty up to this point, there is no query. abandon ship.
+ return () unless $query;
+
+ # sort is treated specially, even though it's actually a filter
+ if ($cgi->param('sort')) {
+ $query =~ s/sort\([^\)]*\)//g; # override existing sort(). no stacking.
+ my ($axis, $desc) = split /\./, $cgi->param('sort');
+ $query .= " sort($axis)";
+ if ($desc and not $query =~ /\#descending/) {
+ $query .= '#descending';
+ } elsif (not $desc) {
+ $query =~ s/\#descending//;
+ }
+ }
+
my $site;
my $org = $ctx->{search_ou};
if (defined($org) and $org ne '' and ($org ne $ctx->{aou_tree}->()->id) and not $query =~ /site\(\S+\)/) {
sub load_rresults_bookbag {
my ($self) = @_;
- my $bookbag_id = int($self->cgi->param("bookbag"));
+ my $bookbag_id = int($self->cgi->param("bookbag") || 0);
return if $bookbag_id < 1;
my %authz = $self->ctx->{"user"} ?