Hi there,

I am trying to implement views_query_alter on a search and am having some trouble. I have an exposed filter set as a block in the sidebar, with the result displaying as a page in the main content area. I set up the module and when I test run a simple echo 'foobar' test on another view which is set up as a page, it works. But on the search page, it does not work. My guess is that it has to do with the exposed filter set as a block. My basic setup looks like this.

function views_alterform_views_query_alter(&$view, &$query) {
if ($view->name == 'search2') {
echo "foobar"; /* This one doesn't work */
}

if ($view->name == 'other_view') {
echo "foobar"; /* This one works */
}
}

Does anyone have any insight as to what I might be missing?

Thanks,

Erin

Comments

peter.hellerhoff’s picture

I do not see hook_views_query_alter working with exposed filters at all.
See http://drupal.org/node/1929118

mustanggb’s picture

Issue summary: View changes
Status: Active » Closed (outdated)