I have a box, could be a menu item or just a block, which i'm embedding a view. The view shows list of content types and display how much nodes relate to it using the "Display record count with link" option.
The code for embedding the view is something like this:

$delta = 'nodes_by_type-block';
  list($name, $display_id) = explode('-', $delta);

  if (!$view = views_get_view($name)) {
    return;
  }

  $view->set_display('block');

  // Set the display num in the view (the count).
  $arguments = $view->display_handler->get_option('arguments');
  $arguments['type']['summary_options']['count'] = 0;
  $view->display_handler->override_option('arguments', $arguments);

  $output = $view->execute_display($display_id);
  $content = $output['content'];
  $view->destroy();

  return $content;

The problem is when i have a pager with ajax and i'm going to the next page the setting i overridden aren't being stored. For example, in the code above i disable the option to show the counter. The first page isn't displaying the number of results, when going to the second the counter is on.

From what i can see the it seems that the overridden settings isn't stored to the next page via js or something like this.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

RoySegall’s picture

Status: Active » Needs review
FileSize
2.64 KB
Chris Matthews’s picture

Assigned: RoySegall » Unassigned
Status: Needs review » Needs work
Issue tags: +Needs reroll

The 4 year old patch does not apply to the latest views 7.x-3.x-dev and if still relevant needs to be rerolled.

Checking patch includes/ajax.inc...
Hunk #1 succeeded at 64 (offset 4 lines).
Hunk #2 succeeded at 73 (offset 4 lines).

Checking patch includes/view.inc...
Hunk #1 succeeded at 1337 (offset 41 lines).

Checking patch plugins/views_plugin_display.inc...
error: while searching for:
  function override_option($option, $value) {
    $this->set_override($option, FALSE);
    $this->set_option($option, $value);
  }

  /**

error: patch failed: plugins/views_plugin_display.inc:1041
error: plugins/views_plugin_display.inc: patch does not apply
Andrew Answer’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
2.75 KB

Patch rerolled.