Extension talk:PageHistoryRealnames
Recent Changes
editHi - any reason why this works on page history and not on Recent Changes? Great extensions - thanks. --Robinson Weijman 15:44, 5 January 2010 (UTC)
I messed up
editI believe to have followed the instructions. But the result was frightening: not only the source code showed up before the wiki content, but the desired result didn't show up.
Mediawiki 1.9.3, not production.
--Cybermandrake 14:00, 27 July 2010 (UTC)
- I figured out my mistake: I've downloaded the description files with a PHP extension! Corrected now. --Cybermandrake 14:48, 27 July 2010 (UTC)
How to return real name of user Preference
editI would like to get the realname from LDAP server instead of local user table. I had retrieve LDAP Preferences. $wgLDAPPreferences = array( "TESTAD"=>array( "email"=>"mail","realname"=>"cn","nickname"=>"sAMAccountName","language"=>"preferredLanguage") ); How to return user realname attribute in LDAP to the PageHistory?
Broken in 1.20.x
editWhen I tried to upgrade to 1.20, the history page didn't show up at all, showing a SQL error instead:
==Database error==
A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:
(SQL query hidden)
from within function "IndexPager::reallyDoQuery (history page unfiltered)". Database returned error "1066: Not unique table/alias: 'wm_user' (localhost)".
I tweaked the wfPageHistoryRealnamesQuery function as shown below:
function wfPageHistoryRealnamesQuery( &$pager, &$query ) {
$query['tables'] = array( 'r' => 'revision', 'u' => 'user', 'tag_summary');
$query['join_conds']['u'] = array( 'LEFT JOIN', 'r.rev_user=u.user_id' );
$query['fields'][] = 'u.user_real_name';
return true;
}
and the history page reappeared. I didn't stumble in any undesirable impact so far, so I share this 2¢.
Fix for Mediawiki 1.19
editI don't know about 1.20, but I managed to get this to work on 1.19 by changing a regular expression in PageHistoryRealnames.php
under the function wfPageHistoryRealnamesLineEnding, find the line with the regular expression (preg_match).
change the regex to:
/^(.*mw\-userlink[^>]*>)([^<]*)(<\/a\b[^>]*>)(.*)$/
and then it should work.
Fix for 1.21.x
editAlong with User:Cybermandrake's changes noted above you must also comment out line 50 in PageHistoryRealnames.php where this extension calls for wfLoadExtensionMessages('PageHistoryRealnames');
It is reduntant in 1.21 and will throw an error.
(I wish I had the chops to update this extension. Hopefully someone more knowledgeable can step up.)
Fix for 1.23.x
editI used fix for 1.20 + 1.19 + 1.21 and change table definition to this:
$query['tables'] = array( 'r' => 'revision', 'u' => 'user');
Update
editI just updated the PageHistoryRealnames.php with the above suggested edits. It's working now for 1.25wmf5, but might not on older wikis.
Confirmed working on 1.26.2
editThis extension working as expected on current stable version (1.26.2). Just FYI Ibutakov.smartec (talk) 13:04, 15 April 2016 (UTC)
Confirmed working on 1.27.0
edit^^
Current state
editNote that this extension isn't maintained since ver 0.2 was made 17. Dec 2009. Jeblad (talk) 09:40, 26 November 2016 (UTC)
Confirmed working on 1.29.0
editWorks fine with the update of PageHistoryRealnames.php by user:MHSluka. /MikaelLindmark (talk) 13:54, 27 July 2017 (UTC)