I have a views page with contextual filtering ("/taxonomy/term/%") which has an attachment that is inheriting this filter.

In some valid cases it can happen that the main page has no results, but the attachment still has.

Without caching, this works fine (only the attachment is displayed), but when I turn on time-based caching, all pages without page results display the same attachment content.

Comments

dawehner’s picture

I'm not sure whether the attachment should be shown by default if the actual result is empty, but it's definitive possible to understand that the current behavior can be considered as bug.

Maybe there should be some kind of configuration for your desired behavior.
For a quick workaround you could use global: view in the footer if you don't use advanced attachments features like inherit pagers.

ralf.strobel’s picture

I had really high hopes for this quick workaround, but it doesn't work either. The behavior is exactly the same. When the main view doesn't have any results, then it shows the attachment which was cached for last page which did have results.

I also tried not to inherit the contextual filter, but to retrieve it directly from the URL. Also same behavior.