The current code attempts to send a pingback on insert or update provided that pingbacks have been declared as ok for that content type. However, the node's published/unpublished status is not checked. This means that if the node is saved as unpublished and left for later work, or for publishing by a scheduler, then the pingback is still attempted, but always fails (because the remote site cannot gain access to your content when it tries to verify the pingback request).
It is a very simple change, in pingback_nodeapi(), to ensure that pingbacks are only attempted when the node status is published.
function pingback_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
if (_pingback_valid_for_node_type($node->type)) {
becomes:
function pingback_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
// Check that the node is published (status is true), otherwise the attempted pingback will
// fail because this node will not be viewable by the server we are pinging.
if (_pingback_valid_for_node_type($node->type) && $node->status) {
Jonathan
Comments
Comment #1
jonathan1055 commentedHere is a patch file to do the above. I don't know if you want two-line comment in? I can remove it if required.
Comment #2
andreashaugstrup commentedCommitted to HEAD. Thank you for this jonathan.