Closed (won't fix)
Project:
Views Hacks
Version:
6.x-1.x-dev
Component:
Views Filters Selective
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 May 2010 at 19:46 UTC
Updated:
31 May 2014 at 04:47 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
infojunkieIt should work for all types of exposed filters.
Comment #3
patcon commentedHopefully I'm not off-protocol by opening this, but it seemed to be bang-on, topic-wise:
You say that it should work on any filter, but it seems that the date filter might be the exception. Am I missing something, or is this outside the scope of the module. If it is outside the scope, any pointers in the right direction (or explanations that it's nigh-on impossible), would be greatly appreciated!
Can't believe the low usage on your module, by the way! I'm going to start pimping it out, as it's pretty much a necessity. Auto-submit alone makes this a life-saver! Thanks :)
Comment #4
patcon commentedComment #5
infojunkieThe current version works for all filters of type select, checkbox, or radio. There may be exceptions of course, and I'm always thankful for bug reports.
The version I'm currently working on will also work for text filters, which the module will convert to a select box containing existing values.
Comment #6
roball commentedHm, I have a exposed "Date: Date (node)" filter (coming from the date module) where users can select the year of a publication. The Date year range has been set to "2005:2010" - thus the selection list always offers to choose one from these 6 years. However, there are no publications from the year 2010 at all, so the selection list should not offer that option. However, after enabling the "Views Selective Exposed Filters" module there is no difference - there are still all years offered. Is this a bug? Thanks.
Comment #7
patcon commentedSorry, never said thanks for the reply, infoJunkie! I'm seeing the same issue roball -- just assumed Date must be more complex, and so it was almost understandable that it wouldn't work so easily as other select lists :)
Comment #8
sheilaj commentedIn order for the selection list to be limited to the items - dates, in this case - present in the result set, this option would have to be checked in the exposed filter ui. I used a 'Date: Date (node)' exposed filter as you did and I found that the option to 'Limit list to result set' was not presented. The option to 'Limit list to selected items' was also not presented and this option is produced by the Views module, not the Views Selected Exposed Filters module. Same thing happens with other types of date filters (Node: Post date, User: Created date).
I don't have a solution, just trying to narrow down the problem.
Comment #9
infojunkie@roball: The module isn't picking up that the date filter is exposing a drop-down, and that's why it's not presenting a 'Limit list to result set' option, as noted by sheilaj.
@sheilaj: If you want to help out with this issue, you can find out the structure of the date exposed filter by placing a
dsm($form['options']);in functionviews_filters_selective_form_views_ui_config_item_form_alterbefore the$overrideablecheck. This will help us understand why the check is failing. Or you can remove this check altogether to force the option to appear. But upon execution of the view, you will get SQL errors because theviews_handler_field_filters_selectivefield handler is trying to inject the date filter into the SELECT clause of the query, and it's obviously getting the name of the date field wrong. That's the tricky part.Comment #10
denniemans commentedSubscribe
Comment #11
tsi commentedsubscribing
Comment #12
Steven Monetti commentedHey,
Here is a fix that I've developed. It works for me so try it out:
Add this code in this function: views_filters_selective_form_views_exposed_form_alter in file views_hacks/views_filters_selective/views_handler_field_filters_selective.inc around line 87.
..so that the function looks like this:
Comment #13
infojunkie@stewy85: Thanks for the fix. I will likely create a new hook to allow other filter types to be handled by 3rd-party modules, and include your fix in my own implementation of the hook.
Comment #14
patcon commentedthanks stewy and infojunkie! You guys are awesome.
Just in case anyone needs a patch for a makefile to tide them over in the meantime...
(this is on dev by the way, not beta1, for anyone who's trying to patch)
Comment #15
patcon commentedOh hey, this doesn't work for me, but I've got a bit of a complicated set-up -- "date_filter field doesn't exist in "field list" column" or something to that affect.
But I'm using a user base table for my view, with a join to a the data module table with a custom unix date field. ie. don't let my scenario discourage anyone from trying, but I can't personally vouche for it working :)
Comment #16
infojunkieThis module is no longer maintained for D6 and has been deprecated in favour of https://drupal.org/project/views_selective_filters for D7. Please test there and reopen if necessary.