"If the block of exposed filters is located on the same page as the results, the .form-text text fields don't expose." (http://patrickteglia.com/blog/i-hack-hell-out-views-exposed-filters)

In other words, say I create a view with exposed filters, one of which is a text-field of operator "between." If that block is visible on all pages in a left side-bar, then that between filter works fine. However, on the actual view page for which that block is designated, the two textfields following the "text-field is between:" are invisible (display:none as seen by firebug).

If I'm not making sense, tell me & I'll attach some screens.

Comments

leahecooper’s picture

I have the same problem, and am a little relieved I'm not alone ... thought I was going a little crazy.

Village Internet’s picture

Same issue here. When the exposed view block is displayed on the same page as the original view, the fields are not displayed. Here is the code i see:

<div id="edit-city-wrapper" class="form-item" style="display: none;">

becw’s picture

Version: 6.x-2.3 » 6.x-2.5
StatusFileSize
new7.35 KB
new6.94 KB

I'm having this issue as well; I have a set of filters (non-optional, unlocked operator) exposed and chose the "exposed filters in block" setting. I then place the exposed filters block on on a node page, and also on the actual View page. The filters appear correctly on the node page, but on the view page the input boxes do not appear (see attached screenshots). It seems that dependencies are not processed correctly on the view page.

To duplicate:
1. Import this view: http://drupal.pastebin.com/f5a4d5c64 (a simple demo view, should work on any drupal site)
2. Go to admin/build/blocks and place one of the new blocks ("Exposed form: between_filter_test-page_1") on two pages: 'node/*' and 'between_filter_test'
3. Visit a node page and the 'between_filter_test' page

becw’s picture

Status: Active » Needs review
StatusFileSize
new1.08 KB

This bug happens because Views runs views_process_dependency() on the exposed filters twice, which puts dependency information in Drupal.settings.viewsAjax.formRelationships[#id][num] and [values] twice, which confuses dependency.js. Views is building the exposed filters form twice--once in the block and again when the view is displayed (even though the form isn't displayed in the view).

One way to fix this is to record which elements have been processed in the views_process_dependency() function itself. I've attached a patch uses this method to fix the issue.

However I'm having wicked déjà vu about this issue--I swear we talked about this issue in IRC a few months ago and this very same fix came up. I'm not sure if I just didn't follow through on a bug report or if it would be better to fix this in another place (for example, preventing the exposed filters form from being built twice). Glancing through my logs, I see it was in #drupal-views on Jan 27 2009... http://drupal.org/node/358314 was also mentioned but that patch didn't fix this issue.

merlinofchaos’s picture

Status: Needs review » Fixed

I added a patch that caches the exposed form building, so that it will NOT be built a second time. This should fix this as a side effect.

becw’s picture

Status: Fixed » Needs work

I believe the commit you're referring to is this: http://drupal.org/cvs?commit=219462

I've tested this patch using the steps I laid out in comment #3, and this issue is not fixed. The patch simply stores the form array for exposed filters--it doesn't prevent the element process functions from being run twice. It's the double processing of the form that causes this bug.

krisgraham’s picture

Same issue here. At least I know what's causing it.

subscribing

benone’s picture

subscribing

jacerider’s picture

subscribing

tahiticlic’s picture

bec's patch on #4 corrects it for me, with D6.14 and views 6.x-2.x-dev or 6.x-2-6

merlinofchaos’s picture

Status: Needs work » Needs review

Fixing wrong status

DrupalYedi’s picture

the patch on #4 works for me too, with D6.14 and views 6.x-2.6

rokr’s picture

the patch on #4 works for us too, with D6.14 and views 6.x-2.6

a.catalucci’s picture

Thank you becs, your patch worked for me too!

Bilmar’s picture

I have also come across this issue and found this thread.
The patch worked without any issues. Thank you very much for the great work!

mittalpatel’s picture

I updated the views version to 6.x -2.8 and now it's working like a charm !!!!!

merlinofchaos’s picture

Status: Needs review » Fixed

Ok, committed this.

Status: Fixed » Closed (fixed)

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

vthirteen’s picture

Version: 6.x-2.5 » 6.x-2.11
Status: Closed (fixed) » Active
StatusFileSize
new42.05 KB

reopening this issue because i just stumbled upon it with latest stable views.

exposed "Search: Search Terms" filter in a block. other filters are Node: Published Yes, Node: Type, and a cck textfield.

the result is no input form in the block and when i click apply instead of showing all the results or no result (depending on search filter settings) it redirects to one of the various pages in the same view.

i have to say that i set this exposed filter right after changing some key/label values in the cck textfield that filters the view. i re-checked the whole view after that and everything looks apparently fine. i'm mentioning it just in case.

vthirteen’s picture

forgot to say that the search filter does work when it's exposed but not in the block.

nunami’s picture

I'm also having the same problem. My views being displayed as a block don't show their exposed filters.

I'll look into the above patch and see if that brings about any results

nunami’s picture

the patch in the #4 doesn't seem to work with D6.17 and Views 6.x-2.8

Letharion’s picture

Status: Active » Fixed

The original issue seems to have been fixed.
If this is still a problem for anyone, it's likely not a duplicate issue, but a new problem.
Please open a new issue.

Status: Fixed » Closed (fixed)

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