In some recent revision, we lost the "Please enter some keywords" message.

You get it if you search without keywords from the Search block, but not from search/node.

Noticed when testing #1126688: Allow users to use advanced search without keywords entered on latest 8.x.

CommentFileSizeAuthor
#2 2170411-yuck.patch2.56 KBjhodgdon
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

I'm getting the message on the User search tab but not the Node search tab.

jhodgdon’s picture

Status: Active » Needs review
FileSize
2.56 KB

OK. I've tracked this down... What happens is that for User search, \Drupal\search\Form\SearchPageForm::submitForm() is called as the submit function, and that does the "please enter some keywords" message if there isn't anything there. But for Node search, \drupal\node\Plugin\Search\NodeSearch::searchFormSubmit() is called as the submit function, and that doesn't have the message.

I made a patch to fix this but it involves calling the deprecated form_set_error() function. Yuck. The problem is that NodeSearch is not a form builder so it doesn't have access to the form builder set error function.

jhodgdon’s picture

Status: Needs review » Postponed

We need to redo how errors and warnings are handled in searching on #1366020: Overhaul SearchQuery; make search redirects use GET query params for keywords, which will hopefully take care of this problem, so I'm postponing this until that one is done.

jhodgdon’s picture

Status: Postponed » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.