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
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.
#2
#3
Confirming your patch works great here -- thanks!
#4
Confirming that patch worked. thanks! Seem like its RTBC
#5
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).