Posted by mikestefff on April 13, 2010 at 9:20pm
| Project: | Views |
| Version: | 6.x-2.11 |
| Component: | exposed filters |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (cannot reproduce) |
Issue Summary
Hi,
I noticed this issue in 6.x-2.8. Upgraded to the 6.x-2.10 assuming it was fixed. It wasn't.
With AJAX enabled, exposed filters don't do any filtering at all. Without AJAX, no problem.
If I can provide more info, please ask.
Thanks
Comments
#1
Please follow the the Views issue submission guidelines.
#2
Okay, I'll provide an export of one of the many views. I've read the guidelines and there really isn't much more that should be needed. Any view that is ajax enabled with exposed filters, the filters don't filter on submission. Doesn't matter what's in the view.
If this isn't enough, let me know what you need.
BTW: This particular view includes OG filters. The same issue exists regardless.
$view = new view;$view->name = 'recent_content_all';
$view->description = 'Show all of the recent content';
$view->tag = '';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
'type' => array(
'label' => 'Type',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_node' => 0,
'exclude' => 0,
'id' => 'type',
'table' => 'node',
'field' => 'type',
'relationship' => 'none',
),
'title' => array(
'label' => 'Title',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_node' => 1,
'exclude' => 0,
'id' => 'title',
'table' => 'node',
'field' => 'title',
'relationship' => 'none',
),
'timestamp' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_node' => 0,
'comments' => 1,
'exclude' => 0,
'id' => 'timestamp',
'table' => 'history_user',
'field' => 'timestamp',
'relationship' => 'none',
),
'name' => array(
'label' => 'Author',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'link_to_user' => 1,
'overwrite_anonymous' => 0,
'anonymous_text' => '',
'exclude' => 0,
'id' => 'name',
'table' => 'users',
'field' => 'name',
'relationship' => 'none',
),
'tid' => array(
'label' => 'Tags',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'empty' => '-',
'hide_empty' => 0,
'empty_zero' => 0,
'type' => 'separator',
'separator' => ', ',
'link_to_taxonomy' => 1,
'limit' => 0,
'vids' => array(
'2' => 0,
'1' => 0,
),
'exclude' => 0,
'id' => 'tid',
'table' => 'term_node',
'field' => 'tid',
'relationship' => 'none',
),
'comment_count' => array(
'label' => 'Comments',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'empty' => '0',
'hide_empty' => 0,
'empty_zero' => 0,
'set_precision' => FALSE,
'precision' => 0,
'decimal' => '.',
'separator' => ',',
'prefix' => '',
'suffix' => '',
'exclude' => 0,
'id' => 'comment_count',
'table' => 'node_comment_statistics',
'field' => 'comment_count',
'relationship' => 'none',
),
'last_updated' => array(
'label' => 'Updated',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'target' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'empty' => '',
'hide_empty' => 0,
'empty_zero' => 0,
'date_format' => 'time ago',
'custom_date_format' => '',
'exclude' => 0,
'id' => 'last_updated',
'table' => 'node_comment_statistics',
'field' => 'last_updated',
'relationship' => 'none',
),
));
$handler->override_option('sorts', array(
'score' => array(
'order' => 'DESC',
'id' => 'score',
'table' => 'search_index',
'field' => 'score',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
'last_updated' => array(
'order' => 'DESC',
'granularity' => 'second',
'id' => 'last_updated',
'table' => 'node_comment_statistics',
'field' => 'last_updated',
'relationship' => 'none',
),
));
$handler->override_option('filters', array(
'status' => array(
'operator' => '=',
'value' => '1',
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'status',
'table' => 'node',
'field' => 'status',
'relationship' => 'none',
),
'keys' => array(
'operator' => 'optional',
'value' => '',
'group' => '0',
'exposed' => TRUE,
'expose' => array(
'use_operator' => 0,
'operator' => 'keys_op',
'identifier' => 'keys',
'label' => 'Search',
'optional' => 1,
'remember' => 0,
),
'id' => 'keys',
'table' => 'search_index',
'field' => 'keys',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
'uid' => array(
'operator' => 'in',
'value' => '',
'group' => '0',
'exposed' => TRUE,
'expose' => array(
'use_operator' => 0,
'operator' => 'uid_op',
'identifier' => 'uid',
'label' => 'Author',
'optional' => 1,
'remember' => 0,
'reduce' => 0,
),
'id' => 'uid',
'table' => 'users',
'field' => 'uid',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
'tid' => array(
'operator' => 'or',
'value' => array(),
'group' => '0',
'exposed' => TRUE,
'expose' => array(
'operator' => 'tid_op',
'label' => 'Tag',
'use_operator' => 0,
'identifier' => 'tid',
'optional' => 1,
'single' => 1,
'remember' => 0,
),
'type' => 'textfield',
'limit' => TRUE,
'vid' => '2',
'id' => 'tid',
'table' => 'term_node',
'field' => 'tid',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
'hierarchy' => 0,
),
'type' => array(
'operator' => 'in',
'value' => array(),
'group' => '0',
'exposed' => TRUE,
'expose' => array(
'use_operator' => 0,
'operator' => 'type_op',
'identifier' => 'type',
'label' => 'Type',
'optional' => 1,
'single' => 1,
'remember' => 0,
'reduce' => 0,
),
'id' => 'type',
'table' => 'node',
'field' => 'type',
'override' => array(
'button' => 'Override',
),
'relationship' => 'none',
),
'uid_1' => array(
'operator' => '=',
'value' => '1',
'group' => '0',
'exposed' => TRUE,
'expose' => array(
'operator' => '',
'identifier' => 'uid_1',
'label' => 'My Groups',
'optional' => 1,
'remember' => 0,
),
'id' => 'uid_1',
'table' => 'og_uid',
'field' => 'uid',
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'none',
));
$handler->override_option('cache', array(
'type' => 'none',
));
$handler->override_option('title', 'Recent Content');
$handler->override_option('empty', 'No content has been added.');
$handler->override_option('empty_format', '1');
$handler->override_option('use_ajax', TRUE);
$handler->override_option('distinct', 1);
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', array(
'grouping' => '',
'override' => 1,
'sticky' => 0,
'order' => 'asc',
'columns' => array(
'type' => 'type',
'title' => 'title',
'timestamp' => 'title',
'name' => 'name',
'tid' => 'tid',
'comment_count' => 'comment_count',
'last_updated' => 'last_updated',
),
'info' => array(
'type' => array(
'sortable' => 1,
'separator' => '',
),
'title' => array(
'sortable' => 1,
'separator' => '',
),
'timestamp' => array(
'separator' => '',
),
'name' => array(
'sortable' => 1,
'separator' => '',
),
'tid' => array(
'separator' => '',
),
'comment_count' => array(
'sortable' => 1,
'separator' => '',
),
'last_updated' => array(
'sortable' => 1,
'separator' => '',
),
),
'default' => '-1',
));
$handler = $view->new_display('block', 'Block', 'block_1');
$handler->override_option('block_description', '');
$handler->override_option('block_caching', -1);
#3
If AJAX is enabled and nothing happens, also check your javascript error log (ctrl-shift-j in Firefox) to see if something happens when you click the button.
#4
It submits and you can tell the data is fetched and printed, but the items don't get filtered at all.
No JS errors.
#5
It happens also if you create a page display for this view?
#6
I've only tested with page displays.
#7
Have you not mismatched your filter blocks and displays by any chance? I've just encountered this problem. I was trying to use the "myview-default" exposed block with display page_1 and Ajax didn't work. Turns out the exposed filter must be part of the actual display that you're trying to filter, e.g. in my case "Exposed form: myview-page_1".
#8
The filters aren't exposed into a block. They are just regular exposed filters.
#9
I am having a similar problem...
I created an exposed filter to let the user filter through my News catergories. I used jquery to let the user apply the filters by changing a select box and not by clicking on the Apply button (which I hide with jquery). I also enabled Ajax so that the url stays clean.
Now begins the tricky part: This works perfectly when I put the "Exposed form in block" on "Yes" BUT if I put it on "No", then the Apply button appears each time I change the select box.
Can anyone help me out with this?
#10
No one else is really having this problem? Making me think there is just something crazy going on on my end...
#11
edit
#12
Problem was a very strange theme issue where the Views div class wasn't set.
I recommend setting up views to try to detect that there's no jQuery selector available..
Thanks
#13
I just upgraded a site to 3.0-alpha3 today, and a View that uses a List style (page display) is having this same problem (I think...) (Another site that I've had 3.0-alpha3 on for a while seems to be fine; the only page-display-with-exposed-filters View I have there is a Table-style View. Not sure if that's important, but...) The View in question also has Calendar/Date Browser displays, but they seem to be working fine so far; it's just the list style that's been problematic (though, the Calendar/Date Browser displays don't have exposed filters.)
I have Drupal 6.15, cck 6.x-2.6, views 6.x-3.0-alpha3, calendar 6.x-2.2, and date 6.x-2.4. (I dont' know what the Acquia Drupal distribution is, except to say that that's not what I'm using, I just have a regular Drupal install going on.)
Thank you very much for the help!
Attached is the export of the problematic View (please disregard the empty global text areas; I was making sure there wasn't a problem b/c of that older bug where it didn't like when the Header/Footer/Empty Text things didn't have anything). The problem-display is "page_2".
Please let me know if I can provide any additional information.
#14
Oops... attachment...
#15
To the best of my knowledge, Data/calendar has never worked with AJAX. Not sure who is to blame.
#16
Well, I actually have AJAX enabled for my Calendar/Date Browser view displays, and they're working fine -- though I don't think they're actually using AJAX (since the page URL changes every time you switch to different months, and I don't have any exposed filters). But, regardless, the display that has an exposed filter that isn't working is a list-style page display (the exposed filter, however, is a Date CCK field).
HOWEVER... and more importantly... two developments:
Looking at things in light of this new information, and will report back shortly, hopefully...
#17
Nothing yet... I've re-ordered the filters so the "field_dateevent < now" filter comes before the exposed "field_dateevent" filter. I also changed the non-exposed "field_dateevent" filter to only go to "month" granularity so it matched the exposed "field_dateevent" filter. No change in what happens when I try to use the exposed filter. Again, this was working fine before I upgraded to views 3.0-alpha3 :(
Maybe something to do with the same field for multiple filters?... Or... maybe the fact that I have Date year range: -10:+0 (could the "+0" be upsetting something)? These seem unlikely, but I'm throwing things out there just in case.
Why does the "after clicking Apply" URL have all those date-time elements even though I said only to go to Granularity: Month? This seems like it could be the troublemaker...
(I'm changing this to "active" because it seems that way for me -- though I'm using views 3.0, not 2.10... Of course, feel free to change it back, I'm not sure what the procedure is for this.)
#18
UPDATE:
Date year range: -10:+1 (for both exposed and non-exposed "field_dateevent" filters) had no effect.
Also, it got weirder and more frustrating... I was changing my non-exposed "field_dateevent" filter back to Granularity: Day (from Granularity: Month when I was giving that a go, just in case), things seemed fine when I clicked Update after making this change to "extra settings for filter [filtername]". BUT... then I checked on the other part of the filter, "Configure filter: [filtername]", and it looked good, and I clicked "Update" (why not just "Cancel"? no reason), and it kinda freaked out. Suddenly I had the "Missing date fields!" message under my filter listing in the Views.Filters part of the UI, and when I went back into "extra settings for filter [filtername]" to re-select my date field, everything had been reverted to the default values (not my View's default values, the default values that are there when you first add a date filter). If I re-set all the values I had before under "extra settings", the filter works fine, but not if I try to re-set the regular "configure filter" settings. Gahhh!!
EDIT: Just to add to this update, I also tried adding a new Date filter, and configure its settings (in case, like, the configurations didn't "come over" to the new Views version cleanly), and I ended up with "Missing date fields!" again. Something that's weird is that you have to do the "extra settings" before the "regular settings" for this filter -- it isn't logical and it won't really work well the other way, and when you create a new Date filter, the workflow has you do the "extra" settings first. Maybe, like, because of this backwards-ness, if you edit the "regular settings" it kind of clears the "extra settings," or something like that?...
#19
UPDATE again...
Now I've tried removing the non-exposed "field_dateevent" filter, so there's just one "field_dateevent" filter (it's exposed, it's '-10:+0' date range and "month" granularity, the operator is "Is equal to" and there's no Date default set). I tested this with AJAX enabled and disabled.
Good news: The exposed filter is working.
Bad news: If I try do Update the "regular settings" for the filter, it freaks out again -- "Missing date fields!", "extra settings" back to defaults, etc.
Neutral news: With AJAX disabled, I can see that the end of the URL that was generated by the filter being applied is still super long and strange:
http://www.example.com/calendar/archive?dateevent_value[value][year]=2010&dateevent_value[value][day]=0&dateevent_value[value][hour]=0&dateevent_value[value][minute]=0&dateevent_value[value][second]=0&dateevent_value[value][month]=3
I gotta say, just noticing this now, but (among other things) it's pretty weird that "month" is the last part of the dateevent_value to be in the URL. No idea if this is part of the problem, but it's weird to me.
#20
Please export a feature or view that allows reproduction of problem.
#21
I've got the same problem, on 6.x-2.11.
Oddly, when I am editing the view and I do a preview of the display, the exposed filter works. It's only when I try to view the block as rendered on a normal page that the ajax does nothing. So it may be a theming issue. However I can see no difference between the HTML that the preview generates and the HTML of the block on a page.
I am filtering on a taxonomy term that is assigned to an event, not the date. So I don't think there is any Date module weirdness in play here.
#22
I've got the same problem, on 6.x-2.11.
Oddly, when I am editing the view and I do a preview of the display, the exposed filter works. It's only when I try to view the block as rendered on a normal page that the ajax does nothing. So it may be a theming issue. However I can see no difference between the HTML that the preview generates and the HTML of the block on a page.
#23
Fixed the version number.
Also tried and failed to reproduce this myself.
@rimu
sorry, I can't import your view since it references a number of fields and plugins that I don't have.
#24