Problem/Motivation

There are several use cases where the need arises to alter an imported entity based on the parser result.

HOOK_feeds_presave is great for doing alterations, but parser results are not passed down to this hook.

Proposed resolution

Make the FeedsParserResult $item the third argument for HOOK_feeds_presave().

The signature would change to function hook_feeds_presave(FeedsSource $source, $entity, $parser_item)
I would feel more "right" to me to have $item be argument number 2,
but by adding it as third bakckwards compatability is guaranteed, no one needs to alter the hook.

I will attach a patch soon.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

theduke’s picture

Patch for 7.x-2.x.

theduke’s picture

Status: Active » Needs review
stylesuxx’s picture

Thanks for the patch, works like a charm.

I'd like to see this implemented too.

Cheers
Chris

twistor’s picture

Status: Needs review » Fixed
Issue tags: -API Design

Looks good to me.

7.x http://drupalcode.org/project/feeds.git/commit/32846d4

There is no hook_feeds_presave is 6.x.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Small change to signature