Posted by New Zeal on March 30, 2009 at 12:33am
Jump to:
| Project: | Revision Moderation |
| Version: | 5.x-1.3 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
From what I can see this module does not retain the original node author when a revision is made, instead replaces it with the revision author, even though the revision is sitting in moderation. The source of the problem I traced to this bit of code on line 205 of revision_moderation.module:
if (isset($node->original_node)) {
// Update node table's vid to the original value.
db_query("UPDATE {node} SET vid = %d, title = '%s', status = %d, moderate = %d WHERE nid = %d", $node->original_node->vid, $node->original_node->title, $node->original_node->status, $node->original_node->moderate, $node->nid);
drupal_set_message(t('Your changes have been submitted for moderation.'));
}
which I changed to the following:
if (isset($node->original_node)) {
// Update node table's vid to the original value.
db_query("UPDATE {node} SET vid = %d, title = '%s', status = %d, uid=%d, moderate = %d WHERE nid = %d", $node->original_node->vid, $node->original_node->title, $node->original_node->status, $node->original_node->uid, $node->original_node->moderate, $node->nid);
drupal_set_message(t('Your changes have been submitted for moderation.'));
}
To insert the original author back into the node as well
Comments
#1
I'm not seeing this. While the revision list will say something like "04/01/2009 - 5:51pm by admin" after reverting, when I actually go into the node and look at the Authored By field it is the name of the original author.