Last modified: 2012-08-04 22:26:36 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T40362, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 38362 - Make Special:Listuser includeable on wiki pages
Make Special:Listuser includeable on wiki pages
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
1.19
All All
: Unprioritized minor (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-reviewed
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-12 13:34 UTC by Jacob
Modified: 2012-08-04 22:26 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Bug38362 Patch (2.28 KB, patch)
2012-07-12 14:08 UTC, Jacob
Details
Adds transclude SpecialListusers page (2.28 KB, patch)
2012-07-12 15:58 UTC, Jacob
Details

Description Jacob 2012-07-12 13:34:49 UTC
I have a bunch of user groups with restricted editing access. The groups members needed to be visible so I need to transclude the Special:Listusers page.
Comment 1 Jacob 2012-07-12 14:08:00 UTC
Created attachment 10840 [details]
Bug38362 Patch

Adds transclusion to SpecialListusers. For transclusion it removes groups, # edits, and creation date from the rows.
Comment 2 Jacob 2012-07-12 14:15:05 UTC
This is my first patch ever so I hope I'm in line with all the MediaWiki
standards.

I was also interested in displaying the user_real_name instead of the user_name
for each item. You can do that by adding the following to LocalSettings.php.
This will also make the default Special:Listusers page display user_real_name
also. I don't think there is a way to differentiate from the given hooks.

$wgHooks['SpecialListusersQueryInfo'][] = 'getRealName';
$wgHooks['SpecialListusersFormatRow'][] = 'setRealName';

function getRealName( $special, &$query ) {
    $query['fields'][] = 'user_real_name';
    return true;
}

function setRealName( &$item, $row ) {
    $userPage = Title::makeTitle( NS_USER, $row->user_name );
    $userName = Title::makeTitle( NS_USER, $row->user_real_name );
    if ($userName->getText() != '') {
        $item = Linker::link( $userPage, htmlspecialchars( $userName->getText()) );
    } else {
        $item = Linker::link( $userPage, htmlspecialchars( $userPage->getText()) );
    }

    return true;
}
Comment 3 Jacob 2012-07-12 14:19:48 UTC
Oh yeah, thanks Reedy for all the help. :)
Comment 4 Sam Reed (reedy) 2012-07-12 14:33:02 UTC
I've not actually tested it yet...

But I have committed it ;)

The only minor issue I saw with coding style was trailing whitespace on a couple of lines; very easily fixed!

https://gerrit.wikimedia.org/r/#/c/15544
Comment 5 Sam Reed (reedy) 2012-07-12 15:41:48 UTC
(In reply to comment #4)
> https://gerrit.wikimedia.org/r/#/c/15544

^ There's a couple of comments on there if you want to help address them ;)
Comment 6 Jacob 2012-07-12 15:58:16 UTC
Created attachment 10841 [details]
Adds transclude SpecialListusers page

Adds transclude to SpecialListusers. Fumbled the first patch.
Comment 7 Jacob 2012-07-12 16:05:30 UTC
Ah quite embarrassing! Completely fumbled my first patch. There should be !'s to NOT break functionality. Doh! And I don't have access or know how to use gerrit yet so I'm just re-uploading the patch with those changes. For the documentation description you might change it to:

* (bug 38362) Added transclude functionality to SpecialListuser.

Another way of getting the same functionality without the change to the constructor would be to change the hook

wfRunHooks( 'SpecialListusersFormatRow', array( &$item, $row ) );


to include &$edits and &$created. But one might also want to know in the hook if it's currently being transcluded, in which case you would still want to pass something to the constructor and then to the hook.

Thanks, sorry about the fumble!
Comment 8 Umherirrender 2012-08-04 22:26:36 UTC
Gerrit change #15544 is now successfully merged

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links