Field doesn't fully hide when nothing entered in it

Fayna - June 27, 2008 - 14:52
Project:Link
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:mrfelton
Status:reviewed & tested by the community
Description

My link field is not required and when nothing is entered into it, the 'fieldgroup' background still shows with nothing in it. I have chosen for the label for the link field to be hidden and that is, but the background still somehow hangs around. I think I had this problem in previous versions also.

I know it's the link field because when I enabled the label for display it would be there right with the background with nothing in it.

#1

mrfelton - November 23, 2008 - 20:23
Version:6.x-2.2» 6.x-1.x-dev
Category:support request» bug report
Assigned to:Anonymous» mrfelton

I'm not sure if this is the exact problem described, but in my attempt to recreate this problem I did come across this:

1) create content_type with an optional link filed
2) create a fieldgroup
3) add the link field to the fieldgroup
4) create a node, but do not enter a link
5) view the node - the fieldgroup does not display (as you would expect, but contrary to the original bug report)
6) change the fields display type to 'Separate Title and URL'
7) view the node again - this time, the fieldgroup shows, with the title set to the name of the field, but with no link

Clearly, this field/fieldgroup should not display at all in this situation since no link has been entered in the first placce - and for every other display type, if there is no link, nothing displays.

The attached patch fixes the issue.

AttachmentSize
link.fieldgroup.patch 1.19 KB

#2

mrfelton - November 23, 2008 - 21:29
Status:active» needs review

#3

Kyle Skrinak - December 27, 2008 - 20:29

Confirming your patch works great here -- thanks!

#4

jpsalter - July 14, 2009 - 21:08
Status:needs review» reviewed & tested by the community

Confirming that patch worked. thanks! Seem like its RTBC

#5

c960657 - September 25, 2009 - 12:57

Possibly related to #336426: empty links stored in db? The underlying problem may be that empty elements are saved in the first place (just a guess).

 
 

Drupal is a registered trademark of Dries Buytaert.