Hi,

I have the links_weblink module working nicely.
I added a validation_hook to links_weblink, so it is impossible to insert an weblink which is allready in the system.

/**
 * Implementation of hook_validate().
 */
function links_weblink_validate(&$node) {
if (($row = db_fetch_object( db_query("SELECT l.lid , ln.nid FROM {links} l INNER JOIN
{links_node} ln ON l.lid = ln.lid WHERE l.url ='%s'",
$node->links_weblink_url))) && ($row->nid != $node->nid)){
form_set_error('url', t('Link allready added in the system'));
}
else
{
links_weblink_node_build($node);
}
}

But with adding localize information to the weblink nodetype, I am getting this message 'Link allready added in the system' when I only alter the location information.
Does anybody know how to alter the validation_hook so it is not thinking I want to add a new weblink to the system?

I am not seeing a connection in the database between the location, and the node_links, or links module, please help!
Is there a location variable which I can look into in the links_weblink module?
Thanks in advance.

greetings,
Martijn

Comments

yesct’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +location conflicts with other modules

Martijn, Is this still a problem?
Marking it postponed (needs more info) for now.

summit’s picture

Hi,
Yes it is still a problem to tell if a link is unique. You can tell if a title is unique through the unique_title module, but not if the link itself is unique.
Thanks for going into this!
Greetings,
Martijn

yesct’s picture

Status: Postponed (maintainer needs more info) » Active
yesct’s picture

ankur’s picture

Version: 5.x-2.7 » 7.x-3.x-dev
Status: Active » Closed (won't fix)

If this is still an issue in the 7.x-3.x or 7.x-4.x branch, please feel free to re-open.