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

Zen’s picture

Version: 6.x-1.0-beta2 » 6.x-1.x-dev
Priority: Major » Normal
Status: Active » Postponed (maintainer needs more info)

I have:

  1. created a node, added manual links and submitted it with "publish" unchecked.
  2. edited the same node, check the publish box and submited it again.

I have been unable to duplicate this issue. Please provide more information.
-K