I have a custom module that needs to know when a full node import has been completed. But node_import doesn’t have a hook that allows that.
So here's the patch to add a "node_import_complete" hook.
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | node_import.admin_.inc_.complete_callback.patch | 355 bytes | ahabman |
| import-complete-hook.patch | 1.77 KB | johnalbin |
Comments
Comment #1
johnalbinNeeds review, of course.
Comment #2
Robrecht Jacques commentedOut of curiosity: what does your custom module use that for?
I'm wondering if this hook would need other parameters...
Comment #3
johnalbinI want to batch import some nodes of a particular type that will replace the existing nodes of that type.
So I've…
HOOK_node_import_static()to set a variable to the current time (the first time it is called), andSo I personally don't need anymore params besides $type.
Comment #4
Robrecht Jacques commentedCommitted to 5.x-1.x-dev. Will be included in 5.x-1.6 release.
Comment #5
johnalbinCool!
Comment #6
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #7
ahabman commentedIs this behavior available in 6.x-1.0-rc4?
The code
module_invoke_all('node_import_complete', $type)is not present, but I'm wondering if this functionality got rolled into 6.x in a different way. If not, thoughts on the best place to put the module_invoke_all call? My best guess was in node_import.inc just afterbut this gets called after each row, not after the entire import has completed.
Comment #8
ahabman commented'node_import_complete' callback added to 6.x-1.0-rc4
Comment #9
Robrecht Jacques commented