Modules can't interact when nodes are created from items?

jari - November 20, 2008 - 14:36
Project:FeedAPI
Version:5.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Description

I can't seem to find a way to interact with the node submission that happens when a new node is created from feed items.
I've got my own module with an implementation of hook_nodeapi, but when the node is created, the submit-action is not taken - thus I can't change things for that node when it is created.
I hacked it so that I put my code to the insert-case and modified the $node object there, but the insert is not called when the items are refreshed/updated.

Here's an example of Mailhandler module - this way I could add my ownmodule_mailhandler function and change the node before it is created.

<?php
 
// modules may override node elements before submitting. they do so by returning the node.
 
foreach (module_list() as $name) {
    if (
module_hook($name, 'mailhandler')) {
     
$function = $name .'_mailhandler';
      if (!(
$node = $function($node, $result, $i, $header, $mailbox))) {
       
// Exit if a module has handled the submitted data.
       
break;
      }
    }
  }
?>

 
 

Drupal is a registered trademark of Dries Buytaert.