Hi!
The selected value of the filter is not applied to the site immediately. After selecting a filter (by pressing the "Apply"), the page is reloaded, but it's not enough. We need to reload it again to filter in force.
In this case, if the filter is set via a link (for example, through the <a href="http://mysite.com.au/music?field_city=2"> select a city </ a>), filtered fires immediately.

CommentFileSizeAuthor
#2 screen217.3 KBshevgeny
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

RdeBoer’s picture

Version: 7.x-1.x-dev » 7.x-1.9

I thought I'd fixed that.

Are you on 7.x-1.9 as this issue suggests? Or on 7.x-1.10 ?

Can you please try 7.x-1.x-dev?

If that doesn't work "out of the box", then use the following workaround (using 7.x-1.x-dev):

Put this line in your index.php:

variable_set('global_filter_visible_filters_only', FALSE); // (EDITED)

After you have refreshed the page, you can remove the above line, if it bothers you.

Or using the the database directly, set the variable 'global_filter_visible_filters_only' in the {variable} table to 0, e.g using phpMyAdmin or similar.

If that doesn't work, then I don't know...

Please let us know how you went....

Rik

shevgeny’s picture

FileSize
217.3 KB

Updated to dev-version. All the same. Added the line in index.php in a directory for the main site - an error Ajax. Delete the line - no error, but the situation former. Climbed into the database, you could not find the specified string ('global_filter_visible_filters_only' in the {variable} table)

shevgeny’s picture

Version: 7.x-1.9 » 7.x-1.x-dev
RdeBoer’s picture

Version: 7.x-1.9 » 7.x-1.x-dev

Sorry that should have been this line:

  variable_set('global_filter_visible_filters_only', FALSE);

Insert it into the index.php the line just before last, that is just above the line:

  menu_execute_active_handler();

So your index.php looks like this:

  define('DRUPAL_ROOT', getcwd());

  require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
  drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
  variable_set('global_filter_visible_filters_only', FALSE);
  menu_execute_active_handler();

Then when you're happy it's all working, remove the variable_set(...) line and it will continue to work fine.

shevgeny’s picture

Thanks, it works!

RdeBoer’s picture

Title: The filter does not work immediately. » The filter does not work immediately -- sometimes needs workaround to set variable
Assigned: Unassigned » RdeBoer
Status: Active » Fixed

YAY!

Ok, so we have a problem with core's block visibility function (that's what Views Global Filter uses to decide which filters need to be set...).

May have to either figure this out and fix this in core or make the workaround of #4 a configuration option in the Views Global Filter module...

Rik

Status: Fixed » Closed (fixed)

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

akumajfr’s picture

Any update on this by chance? I'm having the same issue, and adding the variable_set line to my index.php works, but I'd rather not alter core files.

Thanks!

RdeBoer’s picture

Re #8
As mentioned, you can remove that line and your global filters will continue to work.
Rik

t.eshqair’s picture

please give a help :(
I have the same issue and tried to change the index.php as mentioned it doesn't make any change ,
I also tried to change it once and doesn't work.
so I would change that variable immediately from variables table as mentioned but I have found that I cant change or edit data in this table so what should me do , please help !!

RdeBoer’s picture

Status: Closed (fixed) » Active

Hi t.eshqair,

So you used the development snapshot, right? Don't use the official release for this fix.
Then you followed the instructions in #4 of this thread, right?

And you're finding that the filter does not work immediately after you've changed it, but DOES work after you have subsequently refreshed the page?

There's probably something else wrong with your setup.
Please explain clearly what your global filter is and how it is configured.

Do you have a test site I can log into?

Rik

RdeBoer’s picture

Status: Active » Fixed

Fixed in 7.x-1.11 via the newly introduced "Optimise" checkbox on the View Global Filter configuration page.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

error text