]> Sergey Matveev's repositories - public-inbox.git/commitdiff
search_view: show "No results" text on 404
authorEric Wong <e@80x24.org>
Thu, 12 Jan 2023 14:25:47 +0000 (14:25 +0000)
committerEric Wong <e@80x24.org>
Fri, 13 Jan 2023 03:56:11 +0000 (03:56 +0000)
Oops, this was broken a while ago

Fixes: 55263c56cf41c87f (wwwstream: reduce blob fetch paths for ->getline, 2020-07-05)
lib/PublicInbox/SearchView.pm
t/psgi_search.t

index aeee2a2adf08fa5433b6cf0ae8dbbf7b0e0aa61d..8e33079f1f5d1e100e91aef0242779c764f1f1ab 100644 (file)
@@ -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
index 8868f67ee29a4187049a14264ec99122d5048cc2..27946391cfd3030cc4fa6d6356ed7ec4f53cbc95 100644 (file)
@@ -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;