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;
  }
}

Comments

megachriz’s picture

Version: 7.x-2.0-alpha8 » 7.x-2.x-dev
Status: Active » Needs review
StatusFileSize
new1.05 KB

The attached patch fixes the documentation issue.

  • twistor committed bb1d779 on 7.x-2.x authored by MegaChriz
    Issue #2357981 by MegaChriz: hook_feeds_presave: $entity_id is missing
    
twistor’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.