In our current project we want the editors to be able to add links through the node editor but we don't want the links to appear in the content area. Instead we want the links to appear in the right sidebar and for the sidebar to not appear if there are no links. This has proved a problem because the Link module creates an empty Link regardless of whether an actual link is defined or not. Therefore when creating a Block to display the Links in a list the Link Block will be displayed regardless of whether an actual link exists or not. I have gotten around this by defining a query within the Block and testing for empty values in the title and url fields. But it seems to me that it would be better if a node without a link had no entry in the relevant link table.

Comments

mlncn’s picture

Subscribing. Seems to me something to try to do in a larger code cleanup, if it won't cause any problems.

mlncn’s picture

On second thought it may just be the CCK way to create a field for every node?

In any case, this issue seems pretty closely related:

http://drupal.org/node/149746 (don't display label if link is empty)

mlncn’s picture

Title: Empty Link » Empty Link entries should not be saved to database

Marked http://drupal.org/node/187311 as duplicate.

mlncn’s picture

Priority: Normal » Critical

Marked http://drupal.org/node/183984 (Views displays an empty field instead of the empty text) as duplicate. That bug report describes clearly why, when it comes to use with Views integration, saving blank link records is a critical issue for the Link module.

quicksketch’s picture

Status: Active » Closed (works as designed)

It's not link module doing the saving, all this is handled by CCK. It's something that's been a constant problem in both CCK and Views, and wasn't fixed until the new 2.0 versions for Drupal 6. Unfortunately, there's nothing link can do about the data storage systems.