drupal - How can I programmatically add taxonomy terms to a node in hook_nodeapi()? -


I am creating a module for which nodes need to be tagged with taxonium words when they are created To do this, apply hook_nodepy (), and I'm trying to add the word here:

  function hook_nodipy (and $ node, $ s, $ a3 = zero, $ A4 = null) {switch ($ op) {case 'insert': $ node-> Classification = array (1 = & gt; classification_gate_artum (1)); Node_save ($ node); break; }}  

When I call node_service (), the code just goes to a loop, because node_save calls hook_nodeapi (). When I do not call node_service, nothing is saved. If I do, then I am canceled, if I can not. Can You Think Anyone Right?

You can use $ op = "presave" You want to change the classification in that and then the classification module let you save the conditions for that. There is no need to use node_save later in fact node saving should be avoided by noddepo implementation due to your reasons.


Comments