diff --git a/src/lib/Hydra/Controller/Root.pm b/src/lib/Hydra/Controller/Root.pm index 264b4bbb8..3c002cdec 100644 --- a/src/lib/Hydra/Controller/Root.pm +++ b/src/lib/Hydra/Controller/Root.pm @@ -495,6 +495,9 @@ sub steps :Local Args(0) { sub search :Local Args(0) { my ($self, $c) = @_; + + badRequest($c, "Search is disabled in this Hydra instance") if $c->config->{disable_search}; + $c->stash->{template} = 'search.tt'; my $query = trim $c->request->params->{"query"}; diff --git a/src/root/topbar.tt b/src/root/topbar.tt index dc35dd1fe..5447d3f88 100644 --- a/src/root/topbar.tt +++ b/src/root/topbar.tt @@ -121,9 +121,11 @@ [% END %] [% IF showPrivate %] -
- c.req.params.query) %]/> -
+ [% UNLESS c.config.disable_search %] +
+ c.req.params.query) %]/> +
+ [% END %] [% END %]