Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
dawehnerI'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.
Comment #2
ralf.strobel CreditAttribution: ralf.strobel commentedI 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.