The headerimage module currently uses hook_node_prepare() to add it's properties to a node. But as the documentation states for hook_node_prepare():
Act on a node object about to be shown on the add/edit form.
The correct call is hook_node_load(). That function assigns the properties at the correct time when a header image node is loaded. I've attached a patch that fixes this.
I found this bug while using an action in the "Update options" dropdown on the Administer > Content page. Running an action from that page will make a call to hook_node_update(), but the header image properties were never loaded, and therefore it throws an error.
This is an issue in the 6.x branch as well.
| Comment | File | Size | Author |
|---|---|---|---|
| hi-hook_node_load.patch | 2.03 KB | hargobind |
Comments
Comment #1
sense-designCould you also provide a patch for D6, then I will review both
Comment #2
Stevel commentedLooks good to me.
Comment #3
sense-designThanks, will commit it to D7 DEV tonight
Comment #4
sense-designCommitted to DEV: http://drupalcode.org/project/headerimage.git/commit/3363f5d
Comment #5
sense-designComment #6
skaughtI'm my situation if found that both node_prepare and node_load functions are needed. node_load fixed a cron related issue, but removing the hook_prepare killed node/*/edit and node/add.