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

CommentFileSizeAuthor
bug.GIF6.05 KBLausch

Comments

yched’s picture

I 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...

Lausch’s picture

hm, 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.

yched’s picture

You 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.

freeman-1’s picture

This 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.

Lausch’s picture

many thanks

http://drupal.org/node/151989

is the solution

the creator of this module should include this in the main package!

greets

Lausch

sun’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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