Extension talk:ShowRealUsernames/Archive 1

Code doesn't seem to work for me. SRUquery throws an exception:

Detected bug in an extension! Hook SRUquery failed to return a value; should return true to continue hook processing or false to abort.

Backtrace:


 * 0 C:\Wiki\htdocs\mediawiki\includes\specials\SpecialListusers.php(112): wfRunHooks('SpecialListuser...', Array)
 * 1 C:\Wiki\htdocs\mediawiki\includes\Pager.php(239): UsersPager->getQueryInfo
 * 2 C:\Wiki\htdocs\mediawiki\includes\Pager.php(148): IndexPager->reallyDoQuery('', 51, true)
 * 3 C:\Wiki\htdocs\mediawiki\includes\specials\SpecialListusers.php(157): IndexPager->doQuery
 * 4 C:\Wiki\htdocs\mediawiki\includes\specials\SpecialListusers.php(269): UsersPager->getBody
 * 1) 5 [internal function]: wfSpecialListusers(NULL, Object(SpecialPage))
 * 6 C:\Wiki\htdocs\mediawiki\includes\SpecialPage.php(771): call_user_func('wfSpecialListus...', NULL, Object(SpecialPage))
 * 7 C:\Wiki\htdocs\mediawiki\includes\SpecialPage.php(559): SpecialPage->execute(NULL)
 * 8 C:\Wiki\htdocs\mediawiki\includes\Wiki.php(229): SpecialPage::executePath(Object(Title))
 * 9 C:\Wiki\htdocs\mediawiki\includes\Wiki.php(59): MediaWiki->initializeSpecialCases(Object(Title), Object(OutputPage), Object(WebRequest))
 * 1) 10 C:\Wiki\htdocs\mediawiki\index.php(116): MediaWiki->initialize(Object(Title), NULL, Object(OutputPage), Object(User), Object(WebRequest))
 * 2) 11 {main}


 * In general, this type of error message is caused by a change in MediaWiki which took place at or before version 1.14a; the easiest fix is to go to the end of whatever routine it's complaining about in the extension (in this case, SRUquery) and add:  Very common to see this when using many old extensions on any of this year's MediaWiki versions, unfortunately. --Carlb 12:15, 10 September 2009 (UTC)

———
 * NOTE:  I had this problem with MW1.15.5, I found that PHP>5.3.0 also causes this problem, even if function does return a value.   You need to edit code to remove ampersands, thus:
 * function SRUquery( &$pager, &$query ) {
 * becomes
 * function SRUquery( $pager, $query ) {
 * and
 * function SRUrow( &$item, $row ) {
 * becomes
 * function SRUrow( $item, $row ) {
 * becomes
 * function SRUrow( $item, $row ) {

Something wrong and extension is not working
MediaWiki 	1.14.0 PHP 	5.2.9 (apache2handler) MySQL 	5.1.33-community

Retrieved from "http://www.mediawiki.org/wiki/Extension:ShowRealUsernames" Warning: Cannot modify header information - headers already sent by (output started at C:\Programme\xampp\htdocs\FYwiki\extensions\ShowRealUsernames\ShowRealUsernames.php:95) in C:\Programme\xampp\htdocs\FYwiki\includes\WebResponse.php on line 16

Warning: Cannot modify header information - headers already sent by (output started at C:\Programme\xampp\htdocs\FYwiki\extensions\ShowRealUsernames\ShowRealUsernames.php:95) in C:\Programme\xampp\htdocs\FYwiki\includes\WebResponse.php on line 16

How can one fix this or how to find the reason? Thanks! --Jostar 09:14, 1 December 2009 (UTC)

Restricting who sees the Real Names
I only wanted 'crats to be able to see the Real Names, so I altered the  function to add a check for the user having the showrealname right, as shown below:

Then I added the following to my  after the require_once call:

I hope that this is useful (I know it works on MW 1.15.4) - I was tempted to change the documentation on the main Extension:ShowRealUsernames page, but I'll leave that to someone else! -- Phantom Steve /talk &#124;contribs \ 16:45, 24 June 2010 (UTC)
 * well looking, works fine, should be added to the extension code --Jostar 22:58, 24 June 2010 (UTC)