The block to select inline diff colouring works fine - but when the new revision is shown on the main screen - the header with the legend in it always shows 'anonymous' as the username.

I noticed a previous post that showed a patch for the block - but I dont think the same change had been made for the inline diff metadata. I simply found that function and made the following change to replicate the other post. Sorry - I'm not sure how to make a patch so I couldn't supply one here - and to be honest someone with better dev credentials should definitely check my work..... But perhaps someone can check my code and make one, or let me know if its going to cause an issue elsewhere.

/**
* Display inline diff metadata.
*/
function theme_diff_inline_metadata($vars)........

in here

-- '!name' => theme('username', array('name' => $node)),
++ '!name' => theme('username', array('account' => $node)),

This problem may have been fixed in the latest dev version - but that is throwing me ajax errors so I cannot check - but thats for another post.......

CommentFileSizeAuthor
#5 inline_diff_username_1242646.patch589 bytesfrjo

Comments

lodey’s picture

Ahh - of course this will just show the $node author - not the revision author..... so it will need more work.

I've checked the latest dev version code and these lines are the same.

I'm guessing we need something more like that used in diff.pages.inc ?

if ($revision->current_vid > 0) {
$form['info'][$revision->vid] = array(
'#markup' => t('!date by !username', array(
'!date' => l(format_date($revision->timestamp, 'small'), "node/$node->nid"),
'!username' => theme('username', array('account' => $revision))))
. (($revision->log != '') ? '

'. filter_xss($revision->log) .'

' : ''),
);

Hopefully this is enough info for someone to suggest a solid fix - even if a bit all over the shot, sorry for that!

lodey’s picture

Ok - I've looked at this a little bit more and seem to have a fix..... again - sorry for not supplying a patch - I haven't quite sussed that bit out yet.

On line 298 I made the change below :

-- '!name' => theme('username', array('name' => $node)),
++ '!name' => theme('username', array('account' => user_load($node->revision_uid))),

This loads the name of the revision author as opposed to the node author when showed in the headers meta data block.

lodey’s picture

Just for clarity on the above!

file - diff.theme.inc

function - function theme_diff_inline_metadata($vars)

line 298

:)

realityloop’s picture

Status: Active » Postponed (maintainer needs more info)

I'm unable to reproduce this with the current dev version could you please try to recreate using that and confirm if it is still an issue?

frjo’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new589 bytes

I can confirm this issue. It popups when you use the inline diff block. The author name displayed in the inline metadata is always "anonymous".

The attached patch fixes this.

P.S. The inline diff feature is really nice! It will please the 50+ editorns on the project I'm working on now.

realityloop’s picture

Status: Needs review » Fixed

thanks for the patch frjo, commited.

Status: Fixed » Closed (fixed)

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

sphopkins’s picture

Version: 7.x-2.0 » 7.x-2.x-dev
Status: Closed (fixed) » Patch (to be ported)

I have noticed that this patch is not in 7.x-2.x-dev. The patch does work in that version

realityloop’s picture

Status: Patch (to be ported) » Closed (fixed)

I don't know where your looking but this is definitely in the 2.x branch