Project:Support desk

About this board

Welcome to the MediaWiki Support desk. This is a place where you can ask any questions you have about installing, using or administrating the MediaWiki software.

(Read this message in a different language)

See also

Before you post

Post a new question

  1. To help us answer your questions, please indicate which version of MediaWiki you are using, as found on your wiki's Special:Version page:
  2. If possible, add $wgShowExceptionDetails = true;error_reporting( -1 );ini_set( 'display_errors', 1 ); to LocalSettings.php in order to make MediaWiki show more detailed error messages.
  3. Please include the web address (URL) to your wiki if possible. It's often easier for us to identify the source of the problem if we can see the error directly.
  4. To start a new thread, click the box with the text "Start a new topic".

Would a parser function be best for a currency/point-based extension?

4
Newman2 (talkcontribs)

Hello. For one of my wikis, I have been planning on creating a point-based extension for a feature that can be used to access certain parts of a wiki (i.e. full versions of games that have demos). However, I am not sure whether I should use a parser function or some other type of extension. Any advice? Thank you for reading.

Bawolff (talkcontribs)
Newman2 (talkcontribs)

Nice, but how can I implement that hook into a currency-like feature?

2A02:AA7:4641:4F52:89D2:2A12:EF5A:26D5 (talkcontribs)

KING ALI Aljanabi MONUIY txt im taking my MONUIY back from Allersommen 1000,000*1000,000+

Reply to "Would a parser function be best for a currency/point-based extension?"

How to Remove Footer Links?

4
49.237.200.144 (talkcontribs)

How can I remove the footer links?: Disclaimer and Privacy

I want to remove them using PHP (not CSS), and I'd like to keep the About link.

49.237.200.144 (talkcontribs)

Apologies! My Mediawiki v1.42.1

TheDJ (talkcontribs)
154.80.63.116 (talkcontribs)

Access ess

Reply to "How to Remove Footer Links?"

MW can't connect to DB though the install script can

6
2A01:CB19:8142:6C00:1CCF:B57E:64A0:D6E5 (talkcontribs)

This is what I did:

1. Create a new MySQL database 'blah_mw' and a user 'blah_user' with all possible privileges on the former.

2. Install MediaWiki, providing the following information to the installation script:

$wgDBtype = 'mysql';
$wgDBserver = 'localhost';
$wgDBname = 'blah_mw';
$wgDBuser = 'blah_user';
$wgDBpassword = 'mynicepassword';

as summed up in LocalSettings.php.

3. Go to http://mywiki.org/, where I obtain the error:

MediaWiki internal error.
 
 Original exception: [ZqEs3UQYlJ7QKxMlbf02vgAAAIA] /   Wikimedia\Rdbms\DBConnectionError: Cannot access the database: Access denied for user 'blah_user'@'localhost' (using password: YES) (localhost)
 Backtrace:
 from /home/blah/public_html/includes/libs/rdbms/loadbalancer/LoadBalancer.php(1138)
 #0 /home/v/public_html/includes/libs/rdbms/loadbalancer/LoadBalancer.php(794): Wikimedia\Rdbms\LoadBalancer->reportConnectionError()
 #1 /home/blah/public_html/includes/libs/rdbms/loadbalancer/LoadBalancer.php(782): Wikimedia\Rdbms\LoadBalancer->getServerConnection()
 #2 /home/blah/public_html/includes/libs/rdbms/database/DBConnRef.php(99): Wikimedia\Rdbms\LoadBalancer->getConnectionInternal()
 #3 /home/blah/public_html/includes/libs/rdbms/database/DBConnRef.php(117): Wikimedia\Rdbms\DBConnRef->ensureConnection()
 #4 /home/blah/public_html/includes/libs/rdbms/database/DBConnRef.php(338): Wikimedia\Rdbms\DBConnRef->__call()
 #5 /home/blah/public_html/includes/libs/rdbms/querybuilder/SelectQueryBuilder.php(747): Wikimedia\Rdbms\DBConnRef->selectField()

It seems that MediaWiki cannot connect to the database. However, when I open it with PHPmyadmin, I can see that the installation script has been able to edit it, so the problem is not related to the credentials I gave.

Does anybody have any clue what the problem can be related to?

Bawolff (talkcontribs)

When you say install script do you mean install.php commandline script or do you mean web installer?

2A01:CB19:8142:6C00:F65B:F11B:9B75:993D (talkcontribs)

I mean the web installer.

2A01:CB19:8142:6C00:F65B:F11B:9B75:993D (talkcontribs)

I should also mention that I use a shared hosting, so I don't have root privileges on the server. The creation of the database and MySQL user were done through the administration panel of the host, and then I downloaded MediaWiki by SSH.

Bawolff (talkcontribs)

That's weird. If it works in one it should work in both.

Try using wgDBServer of 127.0.0.1 instead of localhost, just in case (controls whether to use tcp or unix socket)

2A01:CB19:8142:6C00:679:E05E:1051:3B2A (talkcontribs)

Finally it worked by creating a second user. Apparently my host blocked the first one, probably the web installer had it make too many inserts into the database... Sorry for bothering, thanks a lot for your answers.

Reply to "MW can't connect to DB though the install script can"

help regarding custom titles

2
Icantthinkofanamexd (talkcontribs)

I tried to put the displaytitle on a page of a wiki I'm in, but all I got was this: "Display title "United Kingdomball" was ignored since it is not equivalent to the page's actual title."

This was the context of how I want to add it:

The title of the page is called "UKball", but I placed the code {{DISPLAYTITLE:United Kingdomball}}. The DISPLAYTITLE code ended up failing as a result, and I want to ask: How can I overcome this problem (which is changing the page's display title to something that isn't "related" to the actual title)?

Bawolff (talkcontribs)
Reply to "help regarding custom titles"

Lua error: module 'Module:Message box' not found

1
VonCorax (talkcontribs)

I want to use MediaWiki's Stub template on my own installation. When I try to edit the template file I get the error message "Lua error in package.lua at line 80: module 'Module:Message box' not found." How can I fix this?

Thanks.

Reply to "Lua error: module 'Module:Message box' not found"
Neriah (talkcontribs)

Hi, I noticed that if a user with "bot" permission pinging in the edit summary, the ping is not sent. what can be done? Thanks in advance!

TheDJ (talkcontribs)

Bots are often excluded from pings yes. Which bot and which wiki are we talking about ?

Neriah (talkcontribs)

@TheDJ This is a wiki site that does not belong to the Wikimedia Foundation. Manual edits are made through the bot account, so it is necessary for pings to be sent.

Reply to "Ping from bot"

Extension:GlobalBlocking

7
Nexovia (talkcontribs)

I've already posted about this error but now I've this detailed error while installing the GlobalBlocking extension and I've followed everything mentioned in Extension:GlobalBlocking but facing this problem can anyone help

Database error

A database query error has occurred. This may indicate a bug in the software.

[ZqL81IaLlLGPQ01JYt0l7QAAAAk] /index.php?title=Special:UserLogin&returnto=Special%3AGlobalBlockList Wikimedia\Rdbms\DBQueryError: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading or after adding a new extension?

Please see https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Upgrading and https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:How_to_debug for more information.

Error 1044: Access denied for user '36900384_a'@'192.168.0.%' to database 'globalblocking'

Function: Wikimedia\Rdbms\DatabaseMySQL::doSelectDomain

Query: USE `globalblocking`

Backtrace:

from /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/libs/rdbms/database/Database.php(1236)

#0 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/libs/rdbms/database/Database.php(1220): Wikimedia\Rdbms\Database->getQueryException(string, integer, string, string)

#1 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/libs/rdbms/database/Database.php(1194): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, integer, string, string)

#2 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/libs/rdbms/database/DatabaseMySQL.php(202): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string)

#3 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/libs/rdbms/database/Database.php(1543): Wikimedia\Rdbms\DatabaseMySQL->doSelectDomain(Wikimedia\Rdbms\DatabaseDomain)

#4 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/libs/rdbms/loadbalancer/LoadBalancer.php(922): Wikimedia\Rdbms\Database->selectDomain(Wikimedia\Rdbms\DatabaseDomain)

#5 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/libs/rdbms/loadbalancer/LoadBalancer.php(801): Wikimedia\Rdbms\LoadBalancer->reuseOrOpenConnectionForNewRef(integer, Wikimedia\Rdbms\DatabaseDomain, integer)

#6 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/libs/rdbms/loadbalancer/LoadBalancer.php(793): Wikimedia\Rdbms\LoadBalancer->getServerConnection(integer, string, integer)

#7 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/libs/rdbms/database/DBConnRef.php(99): Wikimedia\Rdbms\LoadBalancer->getConnectionInternal(integer, string, string, integer)

#8 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/libs/rdbms/database/DBConnRef.php(117): Wikimedia\Rdbms\DBConnRef->ensureConnection()

#9 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/libs/rdbms/database/DBConnRef.php(538): Wikimedia\Rdbms\DBConnRef->__call(string, array)

#10 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/extensions/GlobalBlocking/includes/GlobalBlocking.php(313): Wikimedia\Rdbms\DBConnRef->anyString()

#11 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/extensions/GlobalBlocking/includes/GlobalBlocking.php(287): MediaWiki\Extension\GlobalBlocking\GlobalBlocking::getRangeCondition(string)

#12 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/extensions/GlobalBlocking/includes/GlobalBlocking.php(121): MediaWiki\Extension\GlobalBlocking\GlobalBlocking::getGlobalBlockingBlock(string, boolean)

#13 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/extensions/GlobalBlocking/includes/GlobalBlocking.php(38): MediaWiki\Extension\GlobalBlocking\GlobalBlocking::getUserBlockDetails(MediaWiki\User\User, string)

#14 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/extensions/GlobalBlocking/includes/GlobalBlockingHooks.php(102): MediaWiki\Extension\GlobalBlocking\GlobalBlocking::getUserBlock(MediaWiki\User\User, string)

#15 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/HookContainer/HookContainer.php(161): MediaWiki\Extension\GlobalBlocking\GlobalBlockingHooks->onGetUserBlock(MediaWiki\User\User, string, NULL)

#16 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/HookContainer/HookRunner.php(1962): MediaWiki\HookContainer\HookContainer->run(string, array)

#17 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/block/BlockManager.php(186): MediaWiki\HookContainer\HookRunner->onGetUserBlock(MediaWiki\User\User, string, NULL)

#18 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/user/User.php(1406): MediaWiki\Block\BlockManager->getUserBlock(MediaWiki\User\User, MediaWiki\Request\WebRequest, boolean, boolean)

#19 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/user/User.php(1507): MediaWiki\User\User->getBlockedStatus(boolean, boolean)

#20 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/user/PasswordReset.php(349): MediaWiki\User\User->getBlock()

#21 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/user/PasswordReset.php(154): MediaWiki\User\PasswordReset->isBlocked(MediaWiki\User\User)

#22 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/user/PasswordReset.php(124): MediaWiki\User\PasswordReset->computeIsAllowed(MediaWiki\User\User)

#23 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/libs/MapCacheLRU.php(271): MediaWiki\User\PasswordReset->MediaWiki\User\{closure}()

#24 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/user/PasswordReset.php(121): MapCacheLRU->getWithSetCallback(string, Closure)

#25 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/specialpage/LoginSignupSpecialPage.php(1082): MediaWiki\User\PasswordReset->isAllowed(MediaWiki\User\User)

#26 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/specialpage/LoginSignupSpecialPage.php(757): MediaWiki\SpecialPage\LoginSignupSpecialPage->getFieldDefinitions(array)

#27 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/specialpage/AuthManagerSpecialPage.php(695): MediaWiki\SpecialPage\LoginSignupSpecialPage->onAuthChangeFormFields(array, array, array, string)

#28 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/specialpage/LoginSignupSpecialPage.php(708): MediaWiki\SpecialPage\AuthManagerSpecialPage->fieldInfoToFormDescriptor(array, array, string)

#29 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/specialpage/AuthManagerSpecialPage.php(434): MediaWiki\SpecialPage\LoginSignupSpecialPage->getAuthForm(array, string)

#30 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/specialpage/LoginSignupSpecialPage.php(337): MediaWiki\SpecialPage\AuthManagerSpecialPage->trySubmit()

#31 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/specialpage/SpecialPage.php(727): MediaWiki\SpecialPage\LoginSignupSpecialPage->execute(NULL)

#32 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/specialpage/SpecialPageFactory.php(1621): MediaWiki\SpecialPage\SpecialPage->run(NULL)

#33 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/MediaWiki.php(357): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, RequestContext)

#34 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/MediaWiki.php(960): MediaWiki->performRequest()

#35 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/includes/MediaWiki.php(613): MediaWiki->main()

#36 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/index.php(50): MediaWiki->run()

#37 /home/vol15_5/infinityfree.com/if0_36900384/nepalpedia.great-site.net/htdocs/index.php(46): wfIndexMain()

#38 {main}

TheDJ (talkcontribs)

When you login/register, it is running a check by the user against the global blocking table.

Access denied for user '36900384_a'@'192.168.0.%' to database 'globalblocking'

User 36900384_an accessing via '192.168.0.%' cannot read or write to the globalblocking table. You'll have to fix that, it is a database configuration problem.

Nexovia (talkcontribs)

Ok it's a database configuration problem but how can I fix this can you give me little bit idea.

TheDJ (talkcontribs)
Bawolff (talkcontribs)

It should be noted, that access denied might literally mean access denied, but in many setups you will get the same error if you simply forgot to create the database.

Nexovia (talkcontribs)

This was solved by making some changes in database but now another problem has been shown to me.

Nexovia (talkcontribs)

This problem has gone but now I've another problem like this MediaWiki internal error.

Original exception: [ZqODYk6fQHQg5OQmWuIAhQAAAAs] / Wikimedia\Rdbms\DBQueryError: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading or after adding a new extension?

Please see https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Upgrading and https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:How_to_debug for more information.

Error 1146: Table 'if0_36900384_globalblocking.mwfm_l10n_cache' doesn't exist Function: LCStoreDB::get Query: SELECT lc_value FROM `mwfm_l10n_cache` WHERE lc_lang = 'en' AND lc_key = 'deps' LIMIT 1

Reply to "Extension:GlobalBlocking"

clientlogin-Request fails with "missingparam" with parameter provided

2
2A02:810D:4940:1C4:D9A:BF2B:364F:D8C8 (talkcontribs)

Hello everyone. I am trying to make a post request to the mediawiki api with the following url

https://test.domain.de/w/api.php?action=clientlogin&format=json

with my body looking like this

{"logintoken":"e55e353a054628b573a515a6580fa4ed66a235a4%2B%5C","username":"test","password":"test"}

I got the login-token via the get-request https://test.domain.de/w/api.php?action=query&meta=tokens&type=login&format=json

Content-Type is application/json in both instances

and I am getting the following error with the latter post request

{"error":{"code":"missingparam","info":"The \"logintoken\" parameter must be set.","*":"See https://testwiki.sevengamer.de/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> for notice of API deprecations and breaking changes."}}


This does not make sense to me given as i am providing the parameter that the response is telling me is missing. Please help :(

Bawolff (talkcontribs)

Application/json is not a supported content type by the api. Use either multipart/form-data or application/x-www-form-urlencoded for post bodies (and make them in that format)

Reply to "clientlogin-Request fails with "missingparam" with parameter provided"

Search inside a category?

2
Subfader (talkcontribs)

Is there a way to limit a search to only pages inside a category?

Example: Search "scandal" inside Category:Presidents_of_the_United_States

I can't find an extension. Is there a hook that can be used without hardcoding into SpecialSearch.php?

Bawolff (talkcontribs)
Reply to "Search inside a category?"

Redirect to log in page if user not logged in

2
Rakon12 (talkcontribs)

Hello

I'm creating a private wiki. My goal is to have the user immediately redirected to the login page from any page when they're not logged in. But I cannot get it to work without changing the mediawiki sources. I do not want to change the sources for security reasons.

My versions are:

MediaWiki 1.39.4
PHP 8.2.4 (apache2handler)
MariaDB 10.4.28-MariaDB
ICU 71.1

I tried to use a hook but since the not logged in page is a permissionErrorPage the redirect is not executed. The hooks I tried were BeforeInitialize and BeforePageDisplay.

Below my hook handle which i wrote into LocalSettings.php:

$wgHooks['BeforeInitialize'][] = function ( $title, $unused, $output, $user, $request, $mediaWiki ) {
    # Check if the user is not logged in and not login Page
    if ( $user->isAnon() && 
         strcmp($title, SpecialPage::getTitleFor( 'Userlogin' ))) {
        # Get URL
        $title = SpecialPage::getTitleFor( 'Userlogin' );
        $url = $title->getFullURL();
        # Redirect to login page
        $output->redirect( $url );
        return;
    }
    return true;
};

Is there a way to implement my request without changing the mediawiki sources? Or a different handle that suits my needs? I already searched through Manual:Hooks.

Thanks in advance

Ammarpad (talkcontribs)

How did you set up the 'private wiki'? If set up correctly you don't need to do anything. That should be the default, and in fact, only behavior; i.e "user [is] redirected to the login page from any page when they're not logged in."

Reply to "Redirect to log in page if user not logged in"