I have identified a bug from the patch created on the custom duration thread (https://www.drupal.org/node/2506241).

The summary title displayed in Views does not match the cache option selected in the dialog window. The problem is the comparison operator. The value for $this->options['cache_time'] is a string, and it's being compared to an integer of value 0. The result is a TRUE statement that renders "Cache permanent" as the displayed result when "custom" is the cache_time value.

This post describes the issue:
http://stackoverflow.com/questions/6843030/why-does-php-consider-0-to-be...

The common way to fix the problem is to use === as the comparison operator. However, in this case, $this->options['cache_time'] is always defined as a string, and the most concise way to resolve the issue is to compare cache_time to a string value.

I'll post a patch for review.

Comments

sgdev’s picture

Status: Active » Needs review
StatusFileSize
new1.51 KB

Patch is attached for review.

sgdev’s picture

I've revised the patch in #1 to add a space after the colons. This makes it consistent with the text displayed on the first half of the title (for example, "Custom cache: view's first argument").

  • rcodina committed 43cbb31 on 7.x-1.x
    Issue #2539750 by ron_s: Displayed summary title does not match selected...
rcodina’s picture

Status: Needs review » Fixed

Thank you @ron_s for your work. I just commited this!

rcodina’s picture

Status: Fixed » Closed (fixed)

I just created beta5 release with this. Thanks!