user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH] search_view: show "No results" text on 404
Date: Thu, 12 Jan 2023 14:25:47 +0000	[thread overview]
Message-ID: <20230112142547.1945031-1-e@80x24.org> (raw)

Oops, this was broken a while ago

Fixes: 55263c56cf41c87f (wwwstream: reduce blob fetch paths for ->getline, 2020-07-05)
---
 lib/PublicInbox/SearchView.pm | 2 +-
 t/psgi_search.t               | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

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;

                 reply	other threads:[~2023-01-12 14:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230112142547.1945031-1-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).