Mysterious error 'Node no longer exists'

I'm posting this solution in advance for the benefit of others who might trip over this SimpleXML issue.Drupal 6 automatically passes cache_save and cache_get arguments through PHP's serialize/unserialize functions.If you parse an XML string using SimpleXML, it creates an object with invisible properties that won't show up if you do a print_r().This object is a built-in object in PHP terminology, and should not be serialized/unserialized. See the discussion here: http://us3.php.net/manual/en/function.serialize.phpIn my case I was trying to store a string, but unknowingly I was storing an object. I had parsed an RSS feed using SimpleXML and extracted one element like so:$status = $statusobject->channel->item[0]->title;The resulting $status was printable as a string but actually, unbeknownst to me, was an object when passed through D6's cache functions. When D6 attempted to unserialize the stored value, PHP threw an error: "Node no longer exists."A cast fixed the problem:$status = (string) $statusobject->channel->item[0]->title;

Advertising