I'm using the computed field module to add up values listed in a node's noderef children.
When a child is updated, the parents that refer to it should get updated as well.
I have written some PHP that gets run when the child is updated. That code does a db_query and enumerates all the parent nodes of the currently updating node. I would like to call a function that causes each of those parents to be updated.
I can do this manually as follows:
* view child node X
* click "edit" to edit child node X
* change some fields in child node X
* click "save" to cause child node X's computed field to be run
* for each of the parent node Y of child X:
- view parent node Y
- click "edit" to edit parent node Y
- click "save" to cause parent node Y's computed field to be run
I have tried having the child's computed field code call content_update($parent_nid), and this apparently causes the parent's computed field to be re-computed. But it doesn't cause the parent's computed field to be saved the way that just using the GUI to edit and saving the parent does.
What do I need to call on a node to get its computed field to be computed *and* stored?