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 believe this is similar to #1863166: Bad arguments when first optional context argument is unavailable and #1917658: Empty context value results in missing argument in views argument except that the setup is a bit different.
Steps to Reproduce
- Create a View, use a Content pane display
- Add a Contextual filter, change "WHEN THE FILTER VALUE IS NOT AVAILABLE" to "Display empty text" or "Display all values"
- If you chose "Display empty text", add a "No results behavior"
- Set "Argument input" to "Input on pane config"
- Create a Panel Page
- Add an optional argument in the path (ie: example/path/!optional)
- Add your View pane to the Panel page, set the views argument using your panel argument (ie: %optional)
Expected result
When visiting the panel page without an argument (ie: example/path), the view will be displayed according to the Contextual filters default behavior.
Actual result
The view is not displayed at all.
Comment | File | Size | Author |
---|---|---|---|
#5 | 2579409-5.patch | 916 bytes | shubham.prakash |
#2 | ctools-example-views-pane-2579409-2.txt | 11.75 KB | jojonaloha |
#2 | ctools-example-panel-page-2579409-2.txt | 2.55 KB | jojonaloha |
#2 | ctools-views_panes_not_displayed_optional_arg-2579409-2.patch | 1.32 KB | jojonaloha |
Comments
Comment #2
jojonaloha CreditAttribution: jojonaloha at Metal Toad commentedAttached is a patch that resolves this issue for me. I'm also attaching an example of my panel page and views pane. The views pane is a Search API View.
Comment #3
geek-merlinPatch looks reasonable.
Comment #4
Chris Matthews CreditAttribution: Chris Matthews as a volunteer commentedThe 3 year old patch to views_panes.inc does not apply to the latest ctools 7.x-1.x-dev.
Comment #5
shubham.prakash CreditAttribution: shubham.prakash at OpenSense Labs commentedThis patch should ix the issue.
Comment #6
rpayanm