Closed (duplicate)
Project:
Viewfield
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Jan 2012 at 19:02 UTC
Updated:
7 Jun 2013 at 20:33 UTC
Jump to comment: Most recent file
Comments
Comment #1
colle901 commentedI need this as well. Panels will not hide the field because the field is returned with markup (empty divs) even when the view result is empty. I would consider this to be a bug unless there is a workaround I am not aware of.
Comment #2
mattcasey commentedDid you try copying the tpl.php for your field and modifying it in your theme? In D6, you could get a list of templates w/source code by clicking "Information" under Style Settings...also in D6 there was an option on each field to "hide if empty"
Comment #3
kansaj commentedI think the problem has been solved for version 6, but 7 still have the problem.
Comment #4
fraweg commentedHello,
I have the same problem. Did anyone solve this issue?
Best regards
Frank
Edit: Is this project still alive?
Comment #5
moniuch commentedCount me in. And I second the question: is there anybody home?
Comment #6
keithm commentedThis is a theming question that could apply to any field, not just viewfield. One approach is to override theme_field() and note if Views produced any output. For example, you could use the following in your theme's template.php file:
Comment #7
jelle_sThis patch solved the issue without having to override
theme_field(which is a bit drastic)Comment #8
attiks commentedworks for me after clearing the cache
Comment #9
attiks commentedBack to NW, I have a view for openlayers that isn't showing anymore, after reverting the patch it's back again.
Comment #10
juves commented#7 doesn't work for me, I'm still having an empty view-wrapper.
Comment #11
lolmaus commentedWhen a normal field has no data, its wrapping markup and title are not displayed. So marking this back a bug.
Comment #12
leex commented#7 didn't work for me.
Comment #13
merilainen commentedFor me #6 works, but it's not ideal solution.
Comment #14
fraweg commentedThanks sooo much Jelle_S !After clearing the cache #7 works vor me.Best regardsFrankEdit: I crow too soon...Today I see that this issue already there :-( I don't know why...
Intead I want to use the solution ftom #6 but I get this error:
Parse error: syntax error, unexpected T_VARIABLE in /.../sites/all/themes/andromeda/template.php on line 214Has someone a Idea what to do?
Best regards
Frank
Comment #15
SilviuChingaru commentedThis is not a theme issue. Viewfield is prepared for viewing using field API in a wrong way: An empty field should have an empty array of items. This field is not checking on the correct hook hook_field_prepare_view if it is empty or not and the field api is trying to theme an empty field and put the divs arround it because it is told to do so.
@see file.inc in core field module for right approch on empty field: It checks in above hook if a file should not be displayed and is working correctly.
Fixed here: https://drupal.org/node/477244#comment-7510777
Comment #16
SilviuChingaru commentedThis is not a theme issue. Viewfield is prepared for viewing using field API in a wrong way: An empty field should have an empty array of items. This field is not checking on the correct hook hook_field_prepare_view if it is empty or not and the field api is trying to theme an empty field and put the divs arround it because it is told to do so.
@see file.inc in core field module for right approch on empty field: It checks in above hook if a file should not be displayed and is working correctly.
Fixed here: https://drupal.org/node/477244#comment-7510777