The $entity_id is missing from function signature in feeds.api.php as it appears below:
/**
* Invoked before a feed item is saved.
*
* @param FeedsSource $source
* FeedsSource object that describes the source that is being imported.
* @param $entity
* The entity object.
* @param array $item
* The parser result for this entity.
* @param int|null $entity_id
* The id of the current item which is going to be updated. If this is a new
* item, then NULL is passed.
*/
function hook_feeds_presave(FeedsSource $source, $entity, $item) {
if ($entity->feeds_item->entity_type == 'node') {
// Skip saving this entity.
$entity->feeds_item->skip = TRUE;
}
}
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | feeds-hook-feeds-presave-2357981-1.patch | 1.05 KB | megachriz |
Comments
Comment #1
megachrizThe attached patch fixes the documentation issue.
Comment #3
twistor commented