From: Eric Wong Date: Thu, 12 Jan 2023 14:25:47 +0000 (+0000) Subject: search_view: show "No results" text on 404 X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=41fa2087a511d56b4f44271d8ba62675b449bc07 search_view: show "No results" text on 404 Oops, this was broken a while ago Fixes: 55263c56cf41c87f (wwwstream: reduce blob fetch paths for ->getline, 2020-07-05) --- diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm index aeee2a2a..8e33079f 100644 --- a/lib/PublicInbox/SearchView.pm +++ b/lib/PublicInbox/SearchView.pm @@ -82,7 +82,7 @@ retry: mset_summary($ctx, $mset, $q); # appends to {-html_tip} $html = ''; } - html_oneshot($ctx, $code); + html_oneshot($ctx, $code, $html); } # display non-nested search results similar to what users expect from diff --git a/t/psgi_search.t b/t/psgi_search.t index 8868f67e..27946391 100644 --- a/t/psgi_search.t +++ b/t/psgi_search.t @@ -93,6 +93,7 @@ test_psgi(sub { $www->call(@_) }, sub { $res = $cb->(POST('/test/?q=s:bogus&x=m')); is($res->code, 404, 'failed search result gives 404'); + like($res->content, qr/No results found/, "`No results' shown"); is_deeply([], $warn, 'no warnings'); my $mid_re = qr/\Q$mid\E/o;