Closed (duplicate)
Project:
Views (for Drupal 7)
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
17 Dec 2009 at 20:32 UTC
Updated:
16 Mar 2012 at 11:23 UTC
I have a view with a content pane display, with a footer with 'Display even if view has no result' set. When this pane is displayed by a panels page and the view result is empty (no rows), the footer isn't displayed. Where there are rows, the footer displays as expected.
I believe the culprit is in function views_content_views_panes_content_type_render(). This section of code has few comments, so I don't know if this patch is the correct or best fix, but it works for me. It would be nice to get a comment for this if statement at least.
| Comment | File | Size | Author |
|---|---|---|---|
| ctools_views_footer_when_empty.patch | 776 bytes | cedarm |
Comments
Comment #1
merlinofchaos commentedHmm. A work around would be to place something in the empty text, even if it is just a space. This patch does make some level of sense but I am not sure I like having to manually check this stuff.
Comment #2
merlinofchaos commentedIn fact, no. The *intent* is that panes hide themselves if there is no content, unless there is an empty text or the style says to render even if empty.
Comment #3
cedarm commentedSorry Earl, I'm missing something. What do you mean by "style" here? Are we talking on the views or panels level?
Really this is just a usability issue. From a user perspective if I check the "Display even if view has no result" box then I expect the resulting pane should never hide itself.
Also, just checked our production site and I need to clarify. The view display is in fact a block and not a content pane as initially stated. Not sure if this matters.
Comment #4
merlinofchaos commentedOk, I'm convinced to think about this. However, the check is too complex where it is.
There could be other reasons that other displays have for choosing whether or not to display, so the logic should be made into a method that can easily be overridden by the display and thus more easily used in other situations.
Comment #5
merlinofchaos commentedI think Views has to provide the mechanism properly.
Comment #6
iamjon commentedI've marked this as an unassigned task. If anyone would like to role up their sleeves and take it upon themselves to write a patch it would be awesome
Comment #7
ayalon commentedI have no run into the same problem. The footer is not rendered. I tried to fix this but the its a deep problem.
modules/ctools/views_content/plugins/content_types/views.inc
line 211:
Here is the break. Maybe we could add a check here if the footer / header is not empty and then render the pane.
Comment #8
iamjon commentedhi ayalon i spoke with merlinofchaos about your attempt on irc, here are his comments
Hope this helps
Comment #9
iamjon commentedClosing from a lack of activity.
Comment #10
babbage commentedCurious why this was closed due to "lack of activity", as the bug remains, and is easy to reproduce.
Comment #11
dawehnerThere is another issue about the exact same topic: #1217394: Change notice: "Display even if view has no result" not working though i doubt this method can be used for views2