I have the feeling that this feature doesn't work anymore, or I don't understand how it's working.

I have a content with 2 fields : body, and media field.
Media field is optional.

I put media field in left column and body in middle column.
I checked "hide empty regions"

If in the content page the media field hasn't been provided, the div of the left column is displayed anyway, apparently $left is not empty
<div class="field field-name-field-video-event field-type-media field-label-hidden"><div class="field-items"></div></div>

i'm using the last dev version of 22th september

Files: 
CommentFileSizeAuthor
#8 1287302-media-field-empty-no-output.patch861 bytesDave Reid
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]

Comments

swentel’s picture

Status:Active» Postponed (maintainer needs more info)

Works fine here with all other fields - looks like media formatters are rendering something although there isn't something in it. Try experimenting with another field, it that works fine, than it's media.

heyyo’s picture

You're right, i just tested with a text field, and the region left is now empty. I have to look on the media module.

heyyo’s picture

Project:Display Suite» Media

I have just tested this media field without the display suit, the behavior is the same. The media field is displayed even if not filled in the content edition process.

heyyo’s picture

Title:Hide Empty regions not working anymore ?» Media field displayed even if empty
heyyo’s picture

Status:Postponed (maintainer needs more info)» Active
heyyo’s picture

Version:7.x-1.x-dev» 7.x-2.x-dev
jkaine’s picture

I can confirm this error: D7.9 + Media 7.x-1.0-rc2

Specifics:

  • For an image field that is uploaded/managed by a media "Media File Selector" widget,
  • With display (full or teaser) set to use a media style
  • If that image field is left empty on a specific node,
  • The wrapper DIV for the field is still displayed

Example of why this is a problem: I have an image that has a border placed on the wrapper div. Standard Drupal behavior is that if a field is empty, the wrapper DIV for the field is not displayed. With this bug, however, the DIV will be displayed-- this shows the border around an empty space.

I have a hacked solution that involves the template.php file and some CSS. If anyone is interested, let me know and I can post here.

Dave Reid’s picture

Component:Code» Media field
Status:Active» Needs review
StatusFileSize
new861 bytes
PASSED: [[SimpleTest]]: [MySQL] 0 pass(es).
[ View ]

Confirmed. Please test the following patch.

Dave Reid’s picture

Assigned:Unassigned» Dave Reid
Dave Reid’s picture

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.