revision should identify revision author not the original node author

Dave Cohen - September 12, 2007 - 00:07
Project:Revision Moderation
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

A message like this appears when viewing a not-yet-published revision of a node:

You are currently viewing a revision of this post created on 09/11/2007 - 16:51 by AUTHOR.

The problem is that AUTHOR is the node's original author, and not the user who created the revision.

I'm not sure where the "proper" fix for this problem belongs. Revision moderation uses node->name to display the name. So it could be that node_load should load the revision author in addition to and/or instead of the node's original author. Or, it could be that revision moderation should perform the extra query itself to learn the revision author. Or, I suppose it could be that revision moderation intends to display the author name there, in which case the message is very misleading.

#1

Dave Cohen - September 12, 2007 - 00:51

Here's a patch that fixes at least one of the drupal_set_message calls. I think there are others...

AttachmentSize
174888.diff 1.11 KB

#2

Dave Cohen - September 12, 2007 - 00:57
Status:active» needs review

Changing status...

This work sponored by medem.com.

#3

ashtonium - October 5, 2007 - 18:50

Revision author now displayed instead of node author. thanks.

This problem was also reported back at: http://drupal.org/node/140232

#4

ashtonium - October 5, 2007 - 20:50

Editing a revision still displayed the "you are currently editing..." message with the node author name instead of the revision author name.

This patch replicates the fix in Dave Cohen's patch for both the viewing and editing messages.

AttachmentSize
rev_author_name2.patch 1.81 KB

#5

chromix - October 14, 2008 - 20:14

This patch still works on the latest DEV version if you apply it manually. I think this should be committed into the current version since this is a pretty big bug fix, imho.

#6

indianroo - December 15, 2008 - 19:46

Did any notice that the date displayed for the revision is also wrong? It always displays the latest date rather than the date of the revision. No idea what the fix should be as yet.

#7

indianroo - December 16, 2008 - 16:53

I enhanced the code in the patch to this:

$row = array();
$row = db_fetch_array(db_query('SELECT uid, timestamp FROM {node_revisions} WHERE vid = %d', $node->vid));
$current_uid = $row['uid'];
$account = user_load(array('uid' => $current_uid));
drupal_set_message(t('You are currently viewing a revision of this post created on @date by !author.', array('@date' => format_date($row['timestamp'], 'small'), '!author' => theme('username', $account))));

and now displays the correct time as well as the correct author for that revision.

#8

add1sun - December 19, 2008 - 22:35
Version:5.x-1.x-dev» 6.x-1.x-dev

needs to be fixed in both D5 and D6

#9

add1sun - December 19, 2008 - 22:38
Title:currently viewing a revision of this post created ... by AUTHOR» revision should identify revision author not the original node author

changing title to be clearer

#10

add1sun - December 21, 2008 - 00:28

OK, i've got two patches, one for 5 and one for 6. They both fix the name AND the date issue.

AttachmentSize
rev_mod-d6-correct-name-and-date_174888-10.patch 2.21 KB
rev_mod-d5-correct-name-and-date_174888-10.patch 2.17 KB

#11

add1sun - December 24, 2008 - 15:25
Status:needs review» fixed

The patch changed a bit due to other recent fixes going so I just fixed it up. Committed to 5, 6, and HEAD.

#12

System Message - January 7, 2009 - 15:30
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

#13

alevy - March 19, 2009 - 18:06
Status:closed» active

The "Revision: Author" views field still shows the node author, not the revision author. Set to open.

#14

carpintero - March 19, 2009 - 18:56

thanks for re-opening. i also need a fix for this.

when using the "Node revision: Author name" field in views, it shows the original author. i would like to be able to make a view showing the latest revision author.

#15

ian_ir - June 24, 2009 - 22:25

subscribe

#16

brisath - June 28, 2009 - 01:31

Subscribing. I want to take it even farther so that ALL node revision authors can be used in an argument, not just the original author.

 
 

Drupal is a registered trademark of Dries Buytaert.