Project:Support desk

Jump to: navigation, search

About this board

vde   Welcome to's Support desk, where you can ask MediaWiki questions!

There are also other places where to askCommunication: IRCCommunication#Chat, mailing listsMailing lists, Wikimedia Developer Support, Q&A, mwusers (unofficial forum) etc.

Before you post

Post a new question

  1. To help us answer your questions, please always indicate which versions you are using (reported by your wiki's Special:Version page):
    • MediaWiki
    • PHP
    • Database
  2. Please include the URL of your wiki unless you absolutely can't. It's often a lot easier for us to identify the source of the problem if we can look for ourselves.
  3. To start a new thread, click "Start a new topic".
Kazuma20 (talkcontribs)

I was thinking of adding a simple calculator to one wiki I am at. I have a JSON file with data that I want to use and fill a combobox with part of this data too. Is it possible to do this without any extension and/or Javascript? Or I'm required to use both in order to achieve this?


Ciencia Al Poder (talkcontribs)

You need to use both. However, I'm not sure what's the purpose of a JSON file for a calculator.

Kazuma20 (talkcontribs)

Because I need to use specific data and apply that data to the formulas I have.

Ciencia Al Poder (talkcontribs)

Have you tried using a Spreadsheet instead of a wiki? Look at open office/Libre office/Microsoft excel

Reply to "Simple calculator"

Foreign file repository isn't showing any images

X Sturm0vik X (talkcontribs)

We have a wiki accessible on and a file hosting wiki accessible on where all the pictures are supposed to be uploaded to. We tested uploading pictures and posting them on the wiki. Pictures can be uploaded but they can't posted on the wiki where they should be displayed.

This image was uploaded:

This is a link to the sandbox where the same picture is posted but it doesn't appear. Instant Commons isn't working on that page either but it works on the Media Wiki because we use Wikipedia Commons pictures for templates.

This is the code we have for the file repository:

$wgForeignFileRepos[] = [
    'class'                   => 'ForeignAPIRepo',
    'name'                    => 'filewiki',
    'apibase'                 => '',
    'hashLevels'              => 2,
    'fetchDescription'        => true,
    'descriptionCacheExpiry'  => 43200,
    'apiThumbCacheExpiry'     => 86400,
Reply to "Foreign file repository isn't showing any images"
Johnywhy (talkcontribs)

On Special:Upload, when i try to upload a file that was previously deleted, i receive a warning.

Warning: A file by that name has been deleted or moved.

The warning offers "Ignore warning and save file anyway"

That's fine. But, in page source-edit, when i try to re-upload a deleted file, i do NOT get the option to "Ignore warning and save file anyway".-- i'm simply blocked from uploading the file.

How can i purge deleted files, so they can be re-uploaded immediately after deletion?

Is there a file-expiration setting i can add to LocalSettings.php?

Reply to "How To Purge Files on Delete?"

[RESOLVED] Spoilers with lazy loading for heavy content

5 (talkcontribs)


I'm not sure if I understand how browsers (Chrome) should work, but I've faced with the following issue. I have a page that's grown up to 50-60 embedded YouTube videos (due to historical reasons). Page load time now takes about 2-3 minutes and the page along with the tab it's hosted in becomes not responsible: the tab just gets frozen. I don't want to split the page into smaller smaller pages because I want the page keep its history and view count. The idea that came to my mind is hiding all embedded videos into spoilers.

Ok, I've implemented a pure HTML/CSS spoilers solution, but it requires at least label, and input/type=checkbox tags/attributes set to be allowed. HTMLTags does not work because it does not allow to nest tags and content, allowing its content to be plain text only. So, I found another way: the Spoilers extension. The latest version of the extension cannot work because I must use MediaWiki 1.23.6, so I had to downgrade the extension to 1.2 (thanks to Git tags). However, when I enclosed all embedded videos in the spoiler tag, it had no effect, and the browser seemed to load embedded videos even if no spoiler was open. Therefore, I'm stuck with not responsible frozen page.

What I'm looking for is: is there any way of making spoiler-ed content lazy and not load content unless the content becomes visible? I suspect I have wrong assumptions about browser DOM rendering., though, but any ideas are really welcome.

Thank you in advance!

Ciencia Al Poder (talkcontribs)

Using MediaWiki 1.23.6 is a security risk. Please upgrade.

About youtube videos, how are you including them? Maybe the problem is in the way how are they being embedded. (talkcontribs)

Thanks for pointing out the security risk!

I'm currently using Extension:EmbedVideo 2.1.8 that provides <nowiki>{{#ev:youtube}}</nowiki>. (talkcontribs)

Hm, it looks like this is how browsers work. Let's say if have a single div with style=display:none, and many iframes in it, the browser will still load all iframes. and the page gets not responsible and lagging for significant amount of time

Is there probably a workaround, or should I come to terms of splitting the page into smaller ones losing its history consistency? (talkcontribs)

Unfortunately, display:none does not stop browser from rendering and fetching external resources .I finished up with a custom-patched version of the Spoilers extension, where I load the spoiler-ed content lazily using JavaScript. Now the page loads instantly without any lags.

Reply to "[RESOLVED] Spoilers with lazy loading for heavy content"
Guycn2 (talkcontribs)

Is it possible to re-enable the Related Articles feature on Hebrew Wikipedia, for desktop view? After gaining community consensus, of course. It should be possible by changing wmgRelatedArticlesFooterWhitelistedSkins on InitialiseSettings.php, it has already been implemented on ht.wikipedia according to their community request. I'm just asking to make sure it's possible, as we're now discussing about it on he.wikipedia.

Reply to "Enable RelatedArticles for Vector skin on he.wikipedia"

How to subscribe to a Phabricator file?

Guycn2 (talkcontribs)

Hello. I want to be notified every time the "MessagesHE.php" file is modified (whether via an email or an alert on Phabricator, it doesn't matter).

In the "MessagesHE.php" page on Phabricator, I don't see any button that says "Subscribe" or something similar. Is there any way to get notifications or emails for changes to this file?

Reply to "How to subscribe to a Phabricator file?"
Ankur matrix (talkcontribs)

Is there any country and city listing api there from wikivoyage? Can anyone please provide us those links and how to use?


This post was hidden by AhmadF.Cheema (history)
TheDJ (talkcontribs)

I don't know about any. You should ask at wikivoyage though.

Reply to "Country & City Listing API"

Updating Mediawiki from 1.29 to 1.30 - Error: 42601 ERROR: syntax error at or near "ADD"

SoftekIS (talkcontribs)

Hi guys. Long story short, I've taken on the project of upgrading our Mediawiki from 1.15 (I know...) to 1.30. At this point, I've gotten it up to version 1.29 after sorting through the various changes/requirements. But I've finally hit a snag. After moving to version 1.30, it seems Mediawiki still functions just fine, but when I run update.php, I get the error below. In a perfect world we'd be on MySQL/MariaDB since it seems most people use that with Mediawiki, but this is something I've inherited:


...Adding value '3D' to enum type media_type.

[a9ba0b22d75b22a89e363931] [no req]   Wikimedia\Rdbms\DBQueryError from line 114   9 of /var/lib/mediawiki/includes/libs/rdbms/database/Database.php: A database qu   ery error has occurred. Did you forget to run your application's database schema    updater after upgrading?

Query: ALTER TYPE "media_type" ADD VALUE '3D'

Function: Wikimedia\Rdbms\Database::query

Error: 42601 ERROR:  syntax error at or near "ADD"

LINE 1: root@testwiki... */ TYPE "media_type" ADD VALUE ...



#0 /var/lib/mediawiki/includes/libs/rdbms/database/DatabasePostgres.php(262): Wi   kimedia\Rdbms\Database->reportQueryError(string, string, string, string, boolean   )

#1 /var/lib/mediawiki/includes/libs/rdbms/database/Database.php(979): Wikimedia\   Rdbms\DatabasePostgres->reportQueryError(string, string, string, string, boolean   )

#2 /var/lib/mediawiki/includes/installer/PostgresUpdater.php(879): Wikimedia\Rdb   ms\Database->query(string)

#3 [internal function]: PostgresUpdater->addPgEnumValue(string, string)

#4 /var/lib/mediawiki/includes/installer/DatabaseUpdater.php(472): call_user_fun   c_array(array, array)

#5 /var/lib/mediawiki/includes/installer/DatabaseUpdater.php(436): DatabaseUpdat   er->runUpdates(array, boolean)

#6 /var/lib/mediawiki/maintenance/update.php(204): DatabaseUpdater->doUpdates(ar   ray)

#7 /var/lib/mediawiki/maintenance/doMaintenance.php(92): UpdateMediaWiki->execut   e()

#8 /var/lib/mediawiki/maintenance/update.php(249): require_once(string)

#9 {main}


Product Version
MediaWiki 1.30.0 (4c97eee)

00:35, 3 March 2018

PHP 5.5.38-1~dotdeb+7.1 (apache2handler)
PostgreSQL 8.4.22lts6

The end goal is to get this fully working with 1.30, and then create a fresh VM on Debian 9/Latest PostgreSQL.

Bawolff (talkcontribs)

the ADD VALUE syntax was only added in postgres 9.1. So you should probably move to postgres 9 before h

SoftekIS (talkcontribs)

I'll give that a shot tomorrow. My plan all along was to upgrade the database at some point, but was hoping to get everything working on 1.30 first. But if this works, it's good enough for me :)

SoftekIS (talkcontribs)

Update: upgraded PostgreSQL to 9.5.1, and the script worked. I noticed while reading the script that it references 1.31, so I wonder if that was even intended to be in 1.30 since 1.30 still says it only requires PostgreSQL 8.3+.

Regardless, thanks for the tip!

Bawolff (talkcontribs)
Reply to "Updating Mediawiki from 1.29 to 1.30 - Error: 42601 ERROR: syntax error at or near "ADD""
Andrea.bozzano87 (talkcontribs)

Hi everyone,

for my project, i'm developing some Bots for my Wiki to edit pages.

After i successfully logged in with my script, i need an Edit Token to edit or create pages. My question is: does this mean that I need to retrieve an edit token for each page the bot is gonna edit or do i need just one edit token per session?

I'm using MediaWiki 1.29.2 and developing bots in PHP 7.0.

Bawolff (talkcontribs)

Its probably fine to just use one per session.

If you end up with an error, just fetch a new one and try again.

Andrea.bozzano87 (talkcontribs)

Ok, i'll try to use just 1 edit token. Thank you for your answer :)

This post was hidden by AhmadF.Cheema (history)
Reply to "About Edit Tokens"

Upgrade to mediawiki-1.28.0 Killed my PW and I now cannot log in

6 (talkcontribs)

I got caught unaware with a new update to a new version of MWiki, in which my old password was rendered unusable. This is a local installation with no internet access to any outside my computer, so I have not been "hacked." The account is still there, I simply cannot:

1) log in, won't accept stored password;

2) cannot CHANGE pw because of the above; will not accept "previous" password. I don't really want to set up another account; I want to use the one I already have.

So, how to nuke the existing password and account files, and simply set up a new account over the old one? Surely there's a way to do that.

System: FC Linux, version 4.15.9-200.fc26.x86_64.

星耀晨曦 (talkcontribs)

Will the upgrade lose password? Very strange. Fortunately, we have a command line script to change a user password -- changePassword.php.

2001:16B8:10B9:200:9846:F04:B025:5A5E (talkcontribs)

Sounds like a configuration problem to me. Maybe an update script had been used to convert the passwords to a new format, e.g. to pbkdf2, but LocalSettings.php has been configured not to use this format?

This problem should then not only affect one user, but all users. In this case running changePassword.php would be needed for all users...

星耀晨曦 (talkcontribs)

This script will only change the password for the specified user.

2001:16B8:10B9:200:982A:8317:6182:F7C5 (talkcontribs)

Right. What I wanted to say is: If really all users are affected, changePassword.php is not really a good option. Actually, I - just like you - do not quite understand, how the problem happened. Without knowing what now is wrong exactly, it will be hard to give a good advice.

More investigation will be needed!

星耀晨曦 (talkcontribs)

Have you backed up the pre-upgrade database? This allows you to roll back your upgrade.

Is there a weird thing happening when you run update.php?

Reply to "Upgrade to mediawiki-1.28.0 Killed my PW and I now cannot log in"