To reproduce:

  1. Configure a Views content pane view to get a contextual filter value from a context. Configure the argument to "Hide view" when the contextual filter is not available.
  2. Embed the view in a panel and assign its argument a context that may or may not exist (such as a context derived from a relationship that stems from an optional field)
  3. Observe that, when the context is missing, the view still displays and shows all results.

Expected behavior: View would not display because the contextual filter is missing.

This is caused by code in views_content_views_panes_content_type_render() that falls back to the "all" value for a views contextual filter if the context is missing. The bug only exists when you've configured the view to receive its contextual filter via a context; it behaves correctly when passed in via keywords or other approaches.

Comments

azinck created an issue. See original summary.

azinck’s picture

Status: Active » Needs review
StatusFileSize
new577 bytes
azinck’s picture

Issue summary: View changes
geek-merlin’s picture

Code looks reasonable.

capysara’s picture

I ran into this same issue. I don't think the patch still applies, but I was able to resolve it by deleting the 'all' exception value and leaving it blank. Now it correctly hides when there's nothing passed to contextual filter.

chris matthews’s picture

Status: Needs review » Needs work

The 3 year old patch to views_panes.inc applied cleanly to the latest ctools 7.x-1.x-dev but needs work per the comment in #5

japerry’s picture

Status: Needs work » Closed (outdated)

Drupal 7 is no longer supported, closing.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.