Closed (fixed)
Project:
Views (for Drupal 7)
Version:
5.x-1.6-beta5
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
13 Jun 2007 at 20:12 UTC
Updated:
14 Jul 2012 at 19:34 UTC
Hi Guys,
theres a bug on Exposed Filters.
Example.
I created an integer field "amount"
then i created two Exposed Filters for amount
from
and
"to"
if i search from any value to any value the filter "to" will not work.
i dont get any error, seems like the "to" field will not do anything.
if i move the filter
from up
and "to" down
and try a search egain only "to" will work and from seems like not do anything.
anyone got a patch or workaround for this bug?
$view->exposed_filter = array (
array (
'tablename' => 'node_data_field_amount2',
'field' => 'field_amount2_value_default',
'label' => 'from',
'optional' => '0',
'is_default' => '0',
'operator' => '0',
'single' => '0',
),
array (
'tablename' => 'node_data_field_amount2',
'field' => 'field_amount2_value_default',
'label' => 'to',
'optional' => '0',
'is_default' => '0',
'operator' => '0',
'single' => '0',
),
);
greets
Lausch
Comments
Comment #1
yched commentedI think this is a know limitation of views : you can't have two exposed versions of the 'same' filter.
I'll leave you dig the issue queue, but I think I remember Earl saying that it's an unfortunate structural limitation that would be quite hard to overcome without refactoring a non negligible amount of stuff - maybe for Views 2.0...
Comment #2
Lausch commentedhm, i understand,
did you know any other possibilitie to make a range search?
i mean
if i create two fields and type in the same integer, than i can create two filters and it will work
but then my users have to submit the same integer two times....
and solution known?
greets
Lausch
PS: or what about a patch / workaround? im willing to pay 50 dollars for it.
Comment #3
yched commentedYou can use 'Computed field' module http://drupal.org/project/computed_field to create a hidden field that simply duplicates your original "amount" field.
In order to have this field available in views, you'll have to specify that the field should be stored in the db.
Comment #4
freeman-1 commentedThis was raised earlier (http://drupal.org/node/143981) - and I think it wouldn't be considered a bug per se, but a limitation.
I've gone ahead to make a patch (http://drupal.org/node/151989) to add a set of new 'range' operators that solves this limitation.
Comment #5
Lausch commentedmany thanks
http://drupal.org/node/151989
is the solution
the creator of this module should include this in the main package!
greets
Lausch
Comment #6
sunComment #7
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.