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.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | views_custom_cache-match_title_to_selected_cache-2539750-2.patch | 2.05 KB | sgdev |
| #1 | views_custom_cache-match_title_to_selected_cache-2539750-1.patch | 1.51 KB | sgdev |
Comments
Comment #1
sgdev commentedPatch is attached for review.
Comment #2
sgdev commentedI'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").
Comment #4
rcodinaThank you @ron_s for your work. I just commited this!
Comment #5
rcodinaI just created beta5 release with this. Thanks!