I am working on a site that has one feed importer. This importer is using the node processor as well as two extra modules, feeds_xpathparser and feeds_tamper.
I am building a module that uses hook_nodeapi to manipulate nodes that are of the same content type being used by the Feeds node processor. I am doing things to these nodes using the presave operation. For example:
function my_module_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
if ('special_content_type' == $node->type) {
switch ($op) {
case 'presave':
print_r($node->body,1));
break;
}
}
}
Something as simple as the above causes notices like this:
Notice: Undefined index: xpathparser:0 in FeedsProcessor->map() (line 138 of /sites/all/modules/feeds/plugins/FeedsProcessor.inc).
Notice: Undefined index: xpathparser:1 in FeedsProcessor->map() (line 138 of /sites/all/modules/feeds/plugins/FeedsProcessor.inc).
Notice: Undefined index: xpathparser:2 in FeedsProcessor->map() (line 138 of /sites/all/modules/feeds/plugins/FeedsProcessor.inc).
Notice: Undefined index: xpathparser:3 in FeedsProcessor->map() (line 138 of /sites/all/modules/feeds/plugins/FeedsProcessor.inc).
Notice: Undefined index: xpathparser:4 in FeedsProcessor->map() (line 138 of /sites/all/modules/feeds/plugins/FeedsProcessor.inc).
Notice: Undefined index: xpathparser:5 in FeedsProcessor->map() (line 138 of /sites/all/modules/feeds/plugins/FeedsProcessor.inc).
The amount of notices depends on the number of nodes being manipulated and the number of fields being parsed by the importer.
The attached patch has stopped the notices for me.
| Comment | File | Size | Author |
|---|---|---|---|
| feedsprocessor.patch | 1.32 KB | jh3 |
Comments
Comment #1
jh3 commentedComment #2
aron novakI could reproduce the issue and the patch indeed solves it and it does not result in defects as far as i see.
Comment #4
jh3 commentedfeedsprocessor.patch queued for re-testing.
Comment #6
twistor commented