I have set up a periodic feed importer in drupal which imports nodes and updates existing nodes.
Lets assume the imported xml consits of two fields: the title and a long text field.
I import the nodes in the morning with the following content:
title long text field
1 long text 1
2 long text 2
3 long text 3
So three nodes were correctly created with the two fields. But if I import later and the content of the xml has changed to the following:
title long text field
1 long text 1
2
3 long text 3
As you can see the long text field of the second node is empty, but feeds doesn't update the field. The value after reimport is still 'long text 2'.
I haven't found an option or a module to achieve this. I have tried to manipulate the input data via
hook_feeds_after_parse(FeedsSource $source, FeedsParserResult $result) {
// replace empty results with ' ' (one space), so they gets replaced
for ($i=0; $i < sizeof($result->items); $i++) {
for ($o=0; $o < sizeof($result->items[$i]); $o++) {
if (empty($result->items[$i]['xpathparser:'.$o])) {
$result->items[$i]['xpathparser:'.$o] = ' ';
}
}
}
}
But feeds only jumps into the function if it detects changes in the xml, but i think empty fields don't get considered.