Skip to content
This repository was archived by the owner on Oct 29, 2020. It is now read-only.

Adding query string to search form#3439

Merged
aaronschachter merged 3 commits intoDoSomethingArchive:devfrom
sbsmith86:404-search-text
Nov 17, 2014
Merged

Adding query string to search form#3439
aaronschachter merged 3 commits intoDoSomethingArchive:devfrom
sbsmith86:404-search-text

Conversation

@sbsmith86
Copy link
Contributor

Fixes #3426 . Adding the query string used in the 404 search to the text field in the search form displayed on the 404 page.

@aaronschachter @deadlybutter

@itsjoekent
Copy link
Contributor

looks good to me, I'd wait for @aaronschachter as I'm still new to Drupal

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it possible that the query_string wouldn't be set on just a regular page load? Since the search form appears on every page. Can you confirm in the error logs this isn't flooding with php notice / warnings?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aaronschachter hmmm, no i'm not seeing any errors or warnings. Maybe because I am only passing in the query string argument when rendering the form on the 404 page. But I can do a double check for the existence of the query string to be more defensive.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might just be part of the way a drupal search_form is rendered. If errors aren't not showing up in places like the homepage and stuff, feel free to keep as is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aaronschachter yea, using i'm using drupal_build_form() to render this particular search form which allows you to pass in a form state. So it probably doesn't effect other forms rendered on the page. Not seeing errors related to the search for on any other pages, but I added the double check just in case, as I do think it is important to be more defensive.

@sbsmith86
Copy link
Contributor Author

@aaronschachter is this approved?

@aaronschachter
Copy link
Contributor

Ship it 👍

aaronschachter added a commit that referenced this pull request Nov 17, 2014
Adding query string to search form
@aaronschachter aaronschachter merged commit 6acec81 into DoSomethingArchive:dev Nov 17, 2014
@sbsmith86 sbsmith86 deleted the 404-search-text branch December 18, 2014 22:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

display the text of the search query in the search bar on the 404 page

3 participants