I want to add some hooks on retrieved nodes, which should indicate also whether they are new or updating:

- an alter hook on the $node data would allow a site-specific module to remove keys on the incoming node so they don't clobber a node that is being updated. Eg, you might want the sticky or published flag to be controlled on the Retrieving site.
- a save hook would allow modules to deal with their own incoming data. We could split up handling of comments, CCK fields, and the like into submodules.

Comments

joachim’s picture

PS. The main reason for doing this with two hooks in sequence rather than one is to guarantee that the alter hook runs first before any data is saved.

joachim’s picture

Status: Active » Fixed
StatusFileSize
new26.83 KB

Heyho, another huge patch :)

Here's what it does:

- split out the code for handling a single node from _content_retriever_save_nodes() to _content_retriever_save_node(). Yes, bad names: singular/plural. But to handle that I'd need to rename _content_retriever_save_nodes() and that's really patch creep. Plus there's already a case of that in this module...
- split out unsetting of $node properties such as path, comment, etc to alter hook implementations in an .inc file. This is a temporary measure -- next we want a setting to either preserve the local ones, eg path, or copy the new one.
- split out filefield/imagefield stuff to a new module, content_retriever_process_filefield
- split out the CCK part of _content_retriever_save_file() into content_retriever_process_filefield

The upload module stuff should be farmed out too, but I'm not sure why some of it is done prior to node_save and some of it after, and I don't really have time to figure it out. I'll file a followup issue in case someone else wants to do it.

#708830 by joachim: Added hooks for alter and save on retrieved nodes; split out filefield handling to separate module; split out core node properties handling to an inc file.

Status: Fixed » Closed (fixed)

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