This:

function use_more() {
  if (!empty($this->definition['use more'])) {
    return $this->get_option('use_more');
  }
  return FALSE;
}

Should be:

function use_more() {
  if (!empty($this->definition['use more'])) {
    return $this->get_option('use_more') && !$this->get_option('use_more_always');
  }
  return FALSE;
}

Leading to count queries being executed even if a more link is to be displayed always. Patch coming.

Comments

alex_b’s picture

Assigned: alex_b » Unassigned
Status: Active » Needs review
StatusFileSize
new495 bytes
alex_b’s picture

Title: Count queries run even if 'use pager always' on » Count queries run even if 'Always display more link' on
dawehner’s picture

Version: 7.x-3.x-dev » 6.x-3.x-dev
StatusFileSize
new513 bytes

The same issue is part of 6.x-3.x.

In views the development model is to fix 6.x-3.x patches first in 6.x

Is it just me that this doesn't make logically sense?


+      return $this->get_option('use_more') && !$this->get_option('use_more_always');

If we "use more" and we "use always more", we don't "use more"?

This function is not only used for

    if ($this->use_more()) {
      $this->view->get_total_rows = TRUE;
    }

but also for displaying the row itself.

    if ($this->use_more() && ($this->use_more_always() || $this->view->query->pager->has_more_records())) {

Which will fail here, if we always use the row.

Here is another approach.

ultimike’s picture

dereine's patch looks good to me - I was having a performance issue with the get_total_rows() function due some large table sizes - giving the "Always display more link" some performance gains is exactly what I needed.

-mike

greggles’s picture

Looks good to me as well. And subscribe.

dawehner’s picture

Status: Needs review » Fixed

This was already commited.

greggles’s picture

StatusFileSize
new586 bytes

It's basically the same thing in 6.x-2.x - here's a patch that seems to work for me that I'm providing in case anyone else needs it.

dawehner’s picture

Version: 6.x-3.x-dev » 6.x-2.x-dev
Status: Fixed » Reviewed & tested by the community

Update status and version.

dawehner’s picture

Status: Reviewed & tested by the community » Fixed

Commited to 6.x-2.x

Status: Fixed » Closed (fixed)

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