The theme_link_formatter_separate function does not check for an empty url field, so it outputs markup such as the following when it receives an empty field (i.e., a field with no title or url).

<div class="field field-type-link field-field-links clearfix"> 
    <div class="field-items"> 
            <div class="field-item odd"> 
                      <div class="field-label-inline-first"> 
              Links:&nbsp;</div> 
                    <div class="link-item "><div class="link-url"><a href="/"></a></div></div>        </div> 
        </div> 
</div>

This causes the "Links:" label to display on every page where "Label display" = "Inline" and "Teaser" or "Full node" is "Separate title and URL", even if the page contains no links.

The fix is to return an empty string if both the title and url are empty, instead of returning formatted HTML.

This issue exists in 6.x-2.9 as well as 6.x-2.x-dev. The attached patch is against 6.x-2.x-dev. It is my first Drupal patch, so please let me know if I screwed it up.

CommentFileSizeAuthor
link.patch479 bytesplanigan
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DamienMcKenna’s picture

Issue summary: View changes
Status: Needs review » Closed (won't fix)

Thank you all for your efforts, but I'm sorry to say that the D6 version is no longer supported.