Posted by theduke on July 27, 2012 at 7:27pm
4 followers
| Project: | Feeds |
| Version: | 7.x-2.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
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.
Comments
#1
Patch for 7.x-2.x.
#2
#3
Thanks for the patch, works like a charm.
I'd like to see this implemented too.
Cheers
Chris
#4
Looks good to me.
7.x http://drupalcode.org/project/feeds.git/commit/32846d4
There is no hook_feeds_presave is 6.x.
#5
Automatically closed -- issue fixed for 2 weeks with no activity.