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.

CommentFileSizeAuthor
feedsprocessor.patch1.32 KBjh3

Comments

jh3’s picture

Status: Active » Needs review
aron novak’s picture

Status: Needs review » Reviewed & tested by the community

I could reproduce the issue and the patch indeed solves it and it does not result in defects as far as i see.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, feedsprocessor.patch, failed testing.

jh3’s picture

Status: Needs work » Needs review

feedsprocessor.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, feedsprocessor.patch, failed testing.

twistor’s picture

Status: Needs work » Closed (outdated)