I recognized a problem when using scribfire to post some blogentries to this blog. When I post the entry as Abstract, all went fine. But posting and publishing it, produces an empty body.
So I digged a bit in the sourcecode and found out, that the plugin serendipity_event_imageselectorplus produces this problem.
When the plugin is doing its textformatting, it does not check whether the body and extended field in its given array are really set, but make a replacement on them.
So if you simply publish a post via XML-RPC, the array given to the hook function does not have an entry for body and extended before, but afterwards. And because the body and extended fields were set, they overwrite the existing content.
case 'backend_entry_presave':
if (is_numeric($eventData['id'])) {
// do not check whether entry is really set!!
$eventData['body'] = str_replace('709', $eventData['id'], $eventData['body']);
$eventData['extended'] = str_replace('709', $eventData['id'], $eventData['extended']);
$this->gotMilk = true;
} else {
$this->cache['body'] = $eventData['body'];
$this->cache['extended'] = $eventData['extended'];
}
break;
My bugfix for this, looks like
case 'backend_entry_presave':
if (is_numeric($eventData['id'])) {
if (isset($eventData['body'])) {
$eventData['body'] = str_replace('709', $eventData['id'], $eventData['body']);
}
if (isset($eventData['extended'])) {
$eventData['extended'] = str_replace('709', $eventData['id'], $eventData['extended']);
}
$this->gotMilk = true;
} else {
if (isset($eventData['body'])) {
$this->cache['body'] = $eventData['body'];
}
if (isset($eventData['extended'])) {
$this->cache['extended'] = $eventData['extended'];
}
}
break;
The whole file can be downloaded here until the author provides a bugfix.
Download serendipity_event_imageselectorplus.txt