I'm finding that if I create a views with exposed filters set to required and displayed as a block is causing the normal Drupal core search (and the same for Search API search) blocks to stop working.

On submitting a search using either of these blocks the page just refreshes instead of taking you to search results. If I make the exposed filters "not required" the search blocks work again.

Comments

iancawthorne’s picture

It seems that Panels is thrown into the mix here too as the exposed filter block needs to be within a panel pane to cause this issue.

richsky’s picture

Not quite, I'm having this strange behavior in D6..., even without putting exposed filters in a block.

dawehner’s picture

Status: Active » Closed (works as designed)

It's actually no strange behavior at all.

A exposed form is technical submitted from your browser on all pages, because it is done via the URL automatically, so if you set it to be required, it's REALLY required, simple.

iancawthorne’s picture

Status: Closed (works as designed) » Active

I'm not sure I understand? How can filling in an exposed form in a block and hitting submit and being bounced back to the same location with no warning or result at all be as designed?

If the field is set to un-required, the form submits fine. Surely if the field is "required" and a value has been entered, the behaviour should be the same, and if you don't enter a value you are given a message to reflect this?

silurius’s picture

I am wrestling with this issue as well. Basically, Drupal Search is crippled on any pages that where there appears a view display's required text input exposed filter. Has anyone found a way to work around the problem?

The issue appears to be that these two things aren't getting along:

Search block: <form id="search-block-form" accept-charset="UTF-8" method="post" action="/">
View exposed filter: <form id="views-exposed-form-foo" class="jquery-once-1-processed" accept-charset="UTF-8" method="get" action="/">

I *think* that by changing action in the Search block to point to /node/search might fix this issue, but I haven't figured out how to do this just yet. (It isn't search-block-form.tpl.php, I know that much.)

hefox’s picture

Issue summary: View changes

Verifying bug

Ended up changing to not using required in this instance