During preview, views tries to ignore the query cache, but it does so incorrectly.

There is no second argument to DisplayPluginInterface::getPlugin().

    // Check for already-cached results.
    if (!empty($this->live_preview)) {
       // This is not a thing.
      $cache = $this->display_handler->getPlugin('cache', 'none');
    }
    else {
      $cache = $this->display_handler->getPlugin('cache');
    }

    if ($cache->cacheGet('results')) {
      if ($this->pager->usePager()) {
        $this->pager->total_items = $this->total_rows;
        $this->pager->updatePageInfo();
      }
    }

Comments

twistor created an issue. See original summary.

twistor’s picture

Issue summary: View changes
twistor’s picture

Status: Active » Needs review
StatusFileSize
new1.27 KB
twistor’s picture

Issue summary: View changes
twistor’s picture

Issue summary: View changes
dawehner’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

Oh, yeah i guess we removed the default argument from getPlugin at some point. The fix looks alright.
Let's ensure to add some small test here.

twistor’s picture

Status: Needs work » Needs review
StatusFileSize
new4.2 KB
new5.47 KB

Here's a quick whip up.

The last submitted patch, 7: 2674480-7-should-fail.patch, failed testing.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs tests

Works for me

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.1.x and cherry-picked to 8.0.x. Thanks!

  • catch committed c735b82 on 8.1.x
    Issue #2674480 by twistor: Views does not properly ignore the query...

  • catch committed 47bd01d on 8.0.x
    Issue #2674480 by twistor: Views does not properly ignore the query...

Status: Fixed » Closed (fixed)

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