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.......
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | inline_diff_username_1242646.patch | 589 bytes | frjo |
Comments
Comment #1
lodey commentedAhh - 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!
Comment #2
lodey commentedOk - 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.
Comment #3
lodey commentedJust for clarity on the above!
file - diff.theme.inc
function - function theme_diff_inline_metadata($vars)
line 298
:)
Comment #4
realityloop commentedI'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?
Comment #5
frjo commentedI 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.
Comment #6
realityloop commentedthanks for the patch frjo, commited.
Comment #8
sphopkins commentedI have noticed that this patch is not in 7.x-2.x-dev. The patch does work in that version
Comment #9
realityloop commentedI don't know where your looking but this is definitely in the 2.x branch