Got a bug report from Samir Nassar:

I'm trying out the ping.fm module. I also have pathauto enabled. It seems that the ping.fm module sends out two pings; one for /node/NID and one for path/to/node.

Comments

tomfilepp’s picture

anyone run into a solution for this? i've looked over all the *.module files and phpingfm and can't seem to find any instance that would cause two posts to occur.

for me the first one is ideal, but the second post contains both the ping.fm shortened URL and a shortened one from tumblr. i'd be willing to develop a patch for this but if anyone can identify the problem code that'd be a big help, starting point for me.

i assume it has something to do with the hook that's called after the node is created. perhaps it's just using the wrong hook?

tomfilepp’s picture

on second thought, i am assuming the problem lies here, with hook_nodeapi(). i am wondering, why is it in "update" instead of "insert" on the switch/case? wouldn't it only want to fire when it inserts the node? or am i misinterpreting this method?

line 137 pingfm.module:

/**
* Implementation of hook_nodeapi().
*/
function pingfm_nodeapi(&$node, $op) {
switch ($op) {
case 'insert':
case 'update':
if (!empty($node->status) && !empty($node->pingfm) && !empty($node->pingfm['post'])) {
$replacements = array(
'!title' => $node->title,
'!teaser' => strip_tags($node->teaser),
'!url' => url('node/'. $node->nid, array('absolute' => TRUE)),
'!user' => $node->name,
);
$result = pingfm_post(t($node->pingfm['format'], $replacements), $node->pingfm['method'], $node->title, user_load(array('uid' => $node->uid)));
drupal_set_message($result ? t('Successfully posted to Ping.fm') : t('Failed posting to Ping.fm'), $result ? 'status' : 'warning');
}
break;
}
}

Steven Brown’s picture

I can not reproduce this issue. Please let me know if this is still an issue. Make sure and upgrade to the latest dev or beta release.

Steven Brown’s picture

Status: Active » Closed (fixed)

This should be fixed in either the current dev or beta.