This function function node_assign_owner_action()
is provided by the Drupal 7 API to allow modules change node ownership,
I've searched, but not found a similar function that let me change the ownership of comments. Does anyone know how to change ownership of a comment without hacking the {comment}
table directly, and without breaking existing incoming links?
I know that I can update the fields {comment}.uid
, {comment}.name
and {comment}.mail
with the appropriate values, but as I understand things, contributed modules should never update tables "owned" by another module directly.
The only method I've found so far is to recreate the comment under new ownership. This is not a good solutions because it will invalidate all incoming links that used the permalink associated with the original comment.
comment.api.php
simply dies not have a function to do it. I wonder if it could be handled ore generally, with entity-related functions.