By kayukoff on
Hello!
The documentation says that when hook_comment $op parametre is set to "validate" then
"The user has just finished editing the comment and is trying to preview or submit it. This hook can be used to check or even modify the node. Errors should be set with form_set_error()."
But how could I make node changes (I mean how to modify node in this case)?
Thanks.
Comments
documentation error?
I assume this to be a documentation error - I am sure this should say "modify the comment" not "modify the node".
Anyway, if you want to modify the node that the comment is attached to, you can get the NID from the comment object (or array, depending on the $op) and then load that node, change it and save it. Not nearly as simple as implied by the documentation.
Jeff
________
Drupal Development,
http://marmaladesoul.com
_________
http://marmaladesoul.com