Download & Extend

Include parser result in hook_feeds_presave

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.

AttachmentSizeStatusTest resultOperations
feeds-presave-parseresult-1703074-1.patch1.6 KBIgnored: Check issue status.NoneNone

#2

Status:active» needs review

#3

Thanks for the patch, works like a charm.

I'd like to see this implemented too.

Cheers
Chris

#4

Status:needs review» fixed

Looks good to me.

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

There is no hook_feeds_presave is 6.x.

#5

Status:fixed» closed (fixed)

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

nobody click here