I've been trying to figure out why content_taxonomy is not working with my CCK content type.

I can see that in its hook_field implementation, the insert code modifies $node->taxonomy to add the needed taxonomy terms. I added debugging messages and found that the right terms are getting added to $node->taxonomy, but then after that they disappear. i.e. it looks like $node->taxonomy changes in this module are getting lost.

I read the field.php and the comments in it said that $node was passed by ref only for performance and it wasn't supposed to be modified.

So my question is, what if the module does try to modify it, as content_taxonomy does? Will the modifications just be thrown away when it returns to content.module?

Comments

dopry’s picture

Status: Active » Closed (fixed)

you can modify it and the mods will be saved... with php5 objects are passed by ref by default as well.