Closed (fixed)
Project:
Ping.fm
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Mar 2009 at 20:43 UTC
Updated:
12 Nov 2011 at 05:59 UTC
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
Comment #1
tomfilepp commentedanyone 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?
Comment #2
tomfilepp commentedon 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;
}
}
Comment #3
Steven Brown commentedI 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.
Comment #4
Steven Brown commentedThis should be fixed in either the current dev or beta.