If you can't get a node (because of perms, say), Services returns an array with nid key and value FALSE.

So our test here always works:

function _content_retriever_fetch_node($nid, $session_id, $fields = array()) {
  $result = content_retriever_xmlrpc('node.get', (int)$nid, $fields);
  
  //convert returned array in to a proper object
  if ($result) {

We need to properly check the incoming thing is a proper node; and output an error of some sort if there is a problem.

Comments

joachim’s picture

Status: Active » Fixed
StatusFileSize
new1.61 KB

Turns out the flaw is not there -- we are blindly putting what we get back from that into the $nodes array, so we may be getting an array with just FALSEs.

This patch fixes that -- bad nodes are no longer created.

However, our messages are in a bit of a mess, as I now get:

* There was a problem retrieving node 17.
* There are no new nodes to retrieve. Process complete.

Yeah, haha -- so were there nodes or not?

Leaving follow-up to a later tidy up of our error messaging -- I want to wrap all error messages in a single function that handles knowing whether to do a dsm() as well as a watchdog.

#711480 by joachim: Fixed bad nodes getting created when nodes can't be retrieved.

Status: Fixed » Closed (fixed)

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