Jump to content

Extension talk:PageHistoryRealnames

Add topic
From mediawiki.org
Latest comment: 7 years ago by MikaelLindmark in topic Confirmed working on 1.29.0

Recent Changes

[edit]

Hi - any reason why this works on page history and not on Recent Changes? Great extensions - thanks. --Robinson Weijman 15:44, 5 January 2010 (UTC)Reply

I messed up

[edit]

I 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)Reply

I figured out my mistake: I've downloaded the description files with a PHP extension! Corrected now. --Cybermandrake 14:48, 27 July 2010 (UTC)Reply

How to return real name of user Preference

[edit]

I 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

[edit]

When 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¢.

--Cybermandrake (talk) 17:33, 30 January 2013 (UTC)Reply

Fix for Mediawiki 1.19

[edit]

I 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

[edit]

Along 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

[edit]

I used fix for 1.20 + 1.19 + 1.21 and change table definition to this:

$query['tables'] = array( 'r' => 'revision', 'u' => 'user');

Update

[edit]

I 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

[edit]

This extension working as expected on current stable version (1.26.2). Just FYI Ibutakov.smartec (talk) 13:04, 15 April 2016 (UTC)Reply

Confirmed working on 1.27.0

[edit]

^^

Current state

[edit]

Note that this extension isn't maintained since ver 0.2 was made 17. Dec 2009. Jeblad (talk) 09:40, 26 November 2016 (UTC)Reply

Confirmed working on 1.29.0

[edit]

Works fine with the update of PageHistoryRealnames.php by user:MHSluka. /MikaelLindmark (talk) 13:54, 27 July 2017 (UTC)Reply