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

CommentFileSizeAuthor
#1 _pingback.untilpublished.patch.txt641 bytesjonathan1055

Comments

jonathan1055’s picture

Status: Active » Needs review
StatusFileSize
new641 bytes

Here 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.

andreashaugstrup’s picture

Status: Needs review » Fixed

Committed to HEAD. Thank you for this jonathan.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.