Problem/Motivation
If you have view with a header, and the header is set to "Display even if view has no result.", the header is not shown when there is no result.
Steps to reproduce
- 1. Create a new view
- 2. Add a Header (global text area will work). and check the box for "Display even if view has no result".
- NOTE: Do not set any other exposed inputs.
- 3. Add the view to a page using a viewreference field
- 4. View the page when there is no results for the view. The view is not shown
Proposed resolution
See patch. We need to check for the existence of a header, then check if that header is set to show when the view is empty.
Remaining tasks
Review and test patch once uploaded
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3228829-viewsreferencefieldformatter-does-not.patch | 1.08 KB | swilmes |
Comments
Comment #2
swilmes commentedComment #3
swilmes commentedComment #4
swilmes commentedComment #5
socialnicheguru commentedThe following patches all conflict and work on the same issue and piece of code:
#3228829: ViewsReferenceFieldFormatter does not check for headers set to show on empty.
#3294529: ViewsReferenceFieldFormatter does not render view if it has no results
#3017716: View without empty handling could break caching
Comment #6
seanbA fix for this has been added in #2919092: Viewsreference embeds Views without cache, breaking Dynamic page cache. Could you please check the latest dev version and let me know if this issue has been resolved?
Comment #7
swilmes commentedHey, sorry for the late response. I'm doing some site updates and it looks like this was fixed!
Comment #8
swilmes commented