Updated: Comment #5

Problem/Motivation

We should really, really be using /search/node?keys=mytext rather than /search/node/mytext. Trying to put the keywords into the URL directly really complicates the code, doesn't really provide any benefits, and causes lots of side effects (see Related Issues section).

Proposed resolution

Move the keywords to a ?keys= URL query instead of appending them to the URL.

Write tests for the issues listed as duplicates of this one, to make sure they are actually resolved.

Remaining tasks

Write a patch and update tests as needed.

User interface changes

URLs for searching will change.

API changes

None.

Here is a list of bugs that have been reported that are marked as duplicates of this issue. They would be good to use as test cases:
#890058: Searching for ../../admin takes me to the admin page
#1421560: searches beginning with a . lead to apache Forbidden error
#1529778: Search with validation error (e.g. small word error) blocks new search from search block form
#1754060: Queries run twice (once on wrong thing) after submitting search block forms on main search page
#2017095: After searching for a too-short word, original search keyword is retained in subsequent searches

Note that this other issue would also resolve some of the above bugs:
#1789768: search_box_form_submit() improperly calls form_set_error()

Comments

jhodgdon’s picture

+1.

jhodgdon’s picture

dave reid’s picture

Seems like #753996 is sort of a meta-issue, while smaller tasks like this can be done independently.

jhodgdon’s picture

Title: Consistently use the query string for search keys rather than appending them to the URL » Use the query string for search keys rather than appending them to the URL
Category: feature » task
Priority: Normal » Major

We really need to take care of this issue. I am marking it as a major task, because it is causing several bugs and the only way to fix them is to take the keywords out of their direct place in the URL and make them be a query string. This will greatly simply all sorts of code in the search module too, I believe.

alexpott also just endorsed the idea of doing this. We need to.

I'm going to update the issue summary and include a list of issues this would solve there.

jhodgdon’s picture

Issue summary: View changes

make an issue summary

jhodgdon’s picture

Issue summary: View changes

add another related issue

jhodgdon’s picture

Issue summary: View changes

add a couple more related issues

pwolanin’s picture

Assigned: Unassigned » pwolanin

Will try to get to this next week (Friday) when I have time to code

pwolanin’s picture

Issue summary: View changes

another related issue

pwolanin’s picture

Assigned: pwolanin » Unassigned
Issue summary: View changes

unassigning until I have time in case someone else wants to work on it

jhodgdon’s picture

I would really like to elevate this issue to "critical", except I'm sure that if I do, it will be shot down by the critical issue counting staff. :)

Still... I think this is about the highest-priority issue in search.module and we really need to get it done.

pwolanin: do you think you might have time in the near future, or should we recruit someone else?

jhodgdon’s picture

Status: Active » Postponed

I'm working on #1366020: Overhaul SearchQuery; make search redirects use GET query params for keywords and realizing I cannot fix that issue without also resolving this one. So for the moment I am postponing this issue until that other one is done or abandoned.

jhodgdon’s picture