Last modified: 2008-04-22 10:23:48 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 T11554, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 9554 - Extension user group messages on special:listusers
Extension user group messages on special:listusers
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-04-10 22:49 UTC by Lejonel
Modified: 2008-04-22 10:23 UTC (History)
1 user (show)

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


Attachments

Description Lejonel 2007-04-10 22:49:20 UTC
The messages for user group names from extension i18n files are not used on
Special:Listusers. MediaWiki messages like MediaWiki:group-checkuser,
MediaWiki:grouppage-checkuser or MediaWiki:group-steward-member from extensions
are not used in the user list if the messages are only defined in the i18n file.
If the corresponding pages in the MediaWiki namespace exist on the wiki, those
messages are used.
Comment 1 Rob Church 2007-04-11 02:11:15 UTC
Fixed in r21161.
Comment 2 Emil Podlaszewski 2008-04-22 10:23:48 UTC
On sites which restrict edits only to logged-in users MessageCache::loadAllMessages() is called on every pageview (via Title::userCan()). If additionally the site has many extensions (100+) this becomes pretty heavy (30-40ms overhead)

Consider applying the patch below which makes loadAllMessages() to be called only on Special:Listusers


Index: includes/User.php
===================================================================
--- includes/User.php   (wersja 11849)
+++ includes/User.php   (kopia robocza)
@@ -2541,8 +2541,6 @@
         * @static
         */
        static function getGroupName( $group ) {
-               global $wgMessageCache;
-               $wgMessageCache->loadAllMessages();
                $key = "group-$group";
                $name = wfMsg( $key );
                return $name == '' || wfEmptyMsg( $key, $name )
@@ -2556,8 +2554,6 @@
         * @static
         */
        static function getGroupMember( $group ) {
-               global $wgMessageCache;
-               $wgMessageCache->loadAllMessages();
                $key = "group-$group-member";
                $name = wfMsg( $key );
                return $name == '' || wfEmptyMsg( $key, $name )
@@ -2600,8 +2596,6 @@
         * @return mixed
         */
        static function getGroupPage( $group ) {
-               global $wgMessageCache;
-               $wgMessageCache->loadAllMessages();
                $page = wfMsgForContent( 'grouppage-' . $group );
                if( !wfEmptyMsg( 'grouppage-' . $group, $page ) ) {
                        $title = Title::newFromText( $page );
Index: includes/SpecialListusers.php
===================================================================
--- includes/SpecialListusers.php       (wersja 11849)
+++ includes/SpecialListusers.php       (kopia robocza)
@@ -196,8 +196,10 @@
  * $par string (optional) A group to list users from
  */
 function wfSpecialListusers( $par = null ) {
-       global $wgRequest, $wgOut;
+       global $wgRequest, $wgOut, $wgMessageCache;
 
+       $wgMessageCache->loadAllMessages();
+
        $up = new UsersPager($par);
 
        # getBody() first to check, if empty

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


Navigation
Links