I'm using views_get_view() and $view->set_exposed_input() to build a view in code.

The view has an attachment which inherits the exposed filters. The inheritance works fine when the view is displayed as a page, but when rendered through the views_get_view() the attachment ignores the exposed filters that are being set:

  $view = views_get_view('landmarks');
  $view->set_exposed_input(array('circle' => array('value' => 10, 'location' => 'Boston')));
  $view->build('page_1');
  $return = $view->preview();

Comments

rickmanelius’s picture

Is this still an issue in 6.x-2.16?

Crell’s picture

Category: bug » support
Priority: Normal » Minor

Why are you using views_attach if you're building a view in code yourself? That makes no sense.

rickmanelius’s picture

That's true re:#3. I was thinking of just closing this as a "won't fix" but wanted to see if it wasn't something that was already resolved many versions ago. Thanks @Crell.

Crell’s picture

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