I am facing a very strange issue with the Related links module.
I have a content type - 'blogs' to which I have enabled the related links using manual mode. So initially the node is in 'unpublished' mode and on saving I could see the related links attached to it manually on the front end.
But as soon as I mark that node as 'Published' , the related links disappears. I checked the DB and it seems to be deleted from there as well for that published node.
I checked the code and I found this snippet which is causing the issue :
function relatedlinks_nodeapi(&$node, $op, $arg) {
if (in_array($node->type, variable_get('relatedlinks_node_types', _relatedlinks_node_get_types(TRUE)))) {
switch ($op) {
case 'load':
$node->relatedlinks = _relatedlinks_get_links($node->nid);
break;
default:
// The delete op should be allowed to account for admins who do not have
// the 'add related links' permission.
if (user_access('add related links') || $op == 'delete') {
switch ($op) {
case 'delete':
_relatedlinks_delete_links($node->nid);
_relatedlinks_delete_tracker($node->nid);
break;
case 'update':
_relatedlinks_delete_links($node->nid);
_relatedlinks_delete_tracker($node->nid);
// Fall through.
The 'update' case under hook_nodeapi is deleting the related links i.e this two lines,
_relatedlinks_delete_links($node->nid);
_relatedlinks_delete_tracker($node->nid);
and I assume that as soon as the node is published, the 'update' case is triggered and related links are deleted.
Any help would be highly appreciated !!
Comments
Comment #1
Zen CreditAttribution: Zen commentedI have:
I have been unable to duplicate this issue. Please provide more information.
-K