At the CCK Link field I enabled 'Optional URL' and filled in a 'Static Title'. When the URL is filled out everything is working fine but with an empty URL the static tile I expected to see is not showing up.

The attached patch will fix this but I have no idea what site effects this change might have. I'm also unsure if the current behavior is wanted by some users so that this patch my be optional.

CommentFileSizeAuthor
link.module.patch605 bytesmutzel

Comments

mutzel’s picture

Status: Reviewed & tested by the community » Needs review
kdebaas’s picture

Status: Needs review » Reviewed & tested by the community

I can confirm that the static Title of an optional link does not show up when there is no link. I applied above patch, and the titles reappear, as plain text.

gg4’s picture

Static title is also missing with required URL using "seperate title and url" display option — the URL shows fine.

vunger’s picture

I have version 2.9, not 2.5, but I still had this problem, and that patch fixed it. So I'm wondering, when is the patch going to be integrated into a release? Thanks.

jcfiala’s picture

Status: Reviewed & tested by the community » Fixed

Hokay - patch wouldn't work because the code went to a different place, but I've got this committed.

Status: Fixed » Closed (fixed)

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

TWGerard’s picture

Issue summary: View changes

I applied mutzel's patch and it did not fix the problem for me. I also had to modify the link_field_is_empty function on line 239. Even with the other patch applied, fields were still being saved as empty and therefore not showing up on the front end. One could simply add a return false statement to this function so that no Link fields are set to empty, or add a $field['field-name'] = YOUR_FIELD_NAME clause to the if statement (which is what I did.)
I ALSO had to disable the plain text filter for title-only links in the theme_link_formatter_link_default function on line 896. Not everyone will have to do this, but it's necessary if you have markeup in your static title.

roopeshnaik’s picture

Does anybody have patch for D7 module?