Project:Support desk

Jump to navigation Jump to 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".
Jer Hughes (talkcontribs)

Can I set a DIV's width to the user's "Thumbnail size" preference?

Something like:

<div style="width:{{thumbsize}}"></div>
MarkAHershberger (talkcontribs)

From what I've found, you would have to use JS for this.

thumbsize = mw.user.options.get( 'thumbsize' );

thumbsize would then be index into the PHP variable $wgThumbLimits.

Reply to "Set object to Thumbnail Size Preference"

Malicious slander & wrongful information within Wiki pages

2001:8003:6A61:8100:ACF0:B98C:A6DE:A3CF (talkcontribs)

Hi Wiki team,

I've reviewed a few pages dealing with some natural health sites and political groups. There appear to be issues with content created by opposing interest groups which aim to slander, defame and subvert such sites and groups. One can find stories and information which are slanderous contained on sites and in articles which oppose natural health sites and political groups. For instance, Monsanto and Bayer have created a budget of approximately one billion dollars to defame and subvert those who expose the toxic nature of some of their chemicals and the serious negative effects of agricultural and other chemicals and GMOs, studies which were suppressed or buried in scientific literature and which show growth of tumours in rats and fertility issues in second and third generation, yet those products were approved by the EPA and by the FDA and released on the market and currently in circulation within most parts of the world, causing illness and fertility issues. People must know what they're eating, labeling of products is a must. Further, soil which has been used for growth of GMOs and doused with some chemicals undergoes fundamental changes and the biodiversity mutates and changes. Such practices harm not only the people who eat such crops but soil biology, water and future fertility of the soil. In any case, such companies attempt to discredit those who simply bring studies and information to the public which such companies attempt to suppress or have previously deleted. Their actions are criminal. Though, you have a choice. Don't let these awful people slander and harm sites which promote wholesome living. Natural News site isn't fake news. Whoever has written that content is slandering the site & would have links to Corporations or political groups which aim to harm that site. The content of that web page is inaccurate and defamatory. Please ensure that people who write content aren't doing so to harm others. In the case of whoever wrote the web page for Natural News, the author is causing harm. It's not pseudoscience on NaturalNews, articles reference scientific journals of various disciplines, which public peer reviewed papers. Same journals which are used by tertiary students and researchers in those fields. Some articles are opinion, though opinion articles shouldn't be described as fake news, then you would need to describe most of USA's media as fake news, incl CNN, MSNBC, Disney and others. Can you please check who is writing information and prevent such cases of malicious slander and wrongful defamation?

Thank you & Regards

Concerned Reader PhD

Malyacko (talkcontribs)

Which website is this about? does not host pages about natural health sites and political groups (if does then these pages are out of scope. It is up to each website which information they host or not. Feel free to contact the website that you refer to.

Exception encountered, of type "Error" [b0e71d8cb299650e8368cc76] /mediawiki/index.php?title=Special:Html2Wiki&action=submit Error from line 4617 of /usr/share/mediawiki/languages/Language.php: Using $this when not in object context

P.R.S.D.T.D. (talkcontribs)

I am encountering this exception when trying to use the Html2Wiki extension to import a plaintext html file. I have the rest of the Backtrace here:


#0 /var/lib/mediawiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php(814): Language::formatSize(integer)

#1 /var/lib/mediawiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php(857): SpecialHtml2Wiki->formatValue(integer)

#2 /var/lib/mediawiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php(964): SpecialHtml2Wiki->addFileToResults()

#3 /var/lib/mediawiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php(655): SpecialHtml2Wiki->processFile()

#4 /var/lib/mediawiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php(519): SpecialHtml2Wiki->doUpload()

#5 /var/lib/mediawiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php(220): SpecialHtml2Wiki->doImport()

#6 /usr/share/mediawiki/includes/specialpage/SpecialPage.php(479): SpecialHtml2Wiki->execute(NULL)

#7 /usr/share/mediawiki/includes/specialpage/SpecialPageFactory.php(577): SpecialPage->run(NULL)

#8 /usr/share/mediawiki/includes/MediaWiki.php(282): SpecialPageFactory::executePath(Title, RequestContext)

#9 /usr/share/mediawiki/includes/MediaWiki.php(735): MediaWiki->performRequest()

#10 /usr/share/mediawiki/includes/MediaWiki.php(509): MediaWiki->main()

#11 /usr/share/mediawiki/index.php(43): MediaWiki->run()

#12 {main}

What can I do to resolve this issue?

星耀晨曦 (talkcontribs)

Please ensure that Html2Wiki extension version matches MW core version.

P.R.S.D.T.D. (talkcontribs)

I upgraded everything to 1.31, same error different line:

[e51f192c19e9217fef6b5ed5] /mediawiki/index.php?title=Special:Html2Wiki&action=submit Error from line 4829 of /var/lib/mediawiki/languages/Language.php: Using $this when not in object context


#0 /var/lib/mediawiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php(814): Language::formatSize(integer)

#1 /var/lib/mediawiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php(857): SpecialHtml2Wiki->formatValue(integer)

#2 /var/lib/mediawiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php(964): SpecialHtml2Wiki->addFileToResults()

#3 /var/lib/mediawiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php(655): SpecialHtml2Wiki->processFile()

#4 /var/lib/mediawiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php(519): SpecialHtml2Wiki->doUpload()

#5 /var/lib/mediawiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php(220): SpecialHtml2Wiki->doImport()

#6 /var/lib/mediawiki/includes/specialpage/SpecialPage.php(522): SpecialHtml2Wiki->execute(NULL)

#7 /var/lib/mediawiki/includes/specialpage/SpecialPageFactory.php(568): SpecialPage->run(NULL)

#8 /var/lib/mediawiki/includes/MediaWiki.php(288): SpecialPageFactory::executePath(Title, RequestContext)

#9 /var/lib/mediawiki/includes/MediaWiki.php(861): MediaWiki->performRequest()

#10 /var/lib/mediawiki/includes/MediaWiki.php(524): MediaWiki->main()

#11 /var/lib/mediawiki/index.php(42): MediaWiki->run()

#12 {main}

P.R.S.D.T.D. (talkcontribs)

Is there some other element I am missing?

Ciencia Al Poder (talkcontribs)

Did you also upgraded Html2Wiki as well? If you've also done that, the extension may not be compatible yet with the latest MediaWiki version.

P.R.S.D.T.D. (talkcontribs)

Mediawiki is on 1.31, HTML2wiki has a package for 1.31 which I have installed as well. These together are producing this error. I have updated all dependencies and packages to the best of my abilities in an attempt to resolve this error but have come up empty.

P.R.S.D.T.D. (talkcontribs)

If anyone has any more insight into this issue that would be awesome.

Ciencia Al Poder (talkcontribs)

Try to post on the talk page of the Html2Wiki extension, and/or open a bug about this.

P.R.S.D.T.D. (talkcontribs)

Where might I find a link to their talk page?

AhmadF.Cheema (talkcontribs)
Kifit (talkcontribs)

Same error here with MediaWiki 1.31 and Html2Wiki up to date.

I managed getting rid of it by editing line 814 in /path_to_my_wiki/extensions/Html2Wiki/specials/SpecialHtml2Wiki.php

I commented out the faulty line and replaced it as bellow :

//        return htmlspecialchars( $this->getLanguage()->formatSize( Language::formatSize( $value ) ) );
  return htmlspecialchars( $this->getLanguage()->formatSize( $value ) );

Html2Wiki is now working fine.

Just for the record, as mentioned in the error message, the "formatsize" function is defined into /path_to_my_wiki/languages/Language.php from line 4828 to 4830 :

function formatSize( $size ) {
          return $this->formatComputingNumbers( $size, 1024, "size-$1bytes" );

Hope this helps.

Reply to "Exception encountered, of type "Error" [b0e71d8cb299650e8368cc76] /mediawiki/index.php?title=Special:Html2Wiki&action=submit Error from line 4617 of /usr/share/mediawiki/languages/Language.php: Using $this when not in object context"
Quinnj09 (talkcontribs)

I cannot get pygmentize for Extension:SyntaxHighlight to work, in mediawiki debug log I get:

[exec] Error running "c:\Python27\Scripts\pygmentize.exe" "-l" "sql" "-f" "html" "-O" "cssclass=mw-highlight,encoding=utf-8": 'c:\Python27\Scripts\pygmentize.exe" "-l" "sql" "-f" "html" "-O" "cssclass' is not recognized as an internal or external command, operable program or batch file.

Has anyone got any suggestions for next steps?

MarkAHershberger (talkcontribs)

Does running the command from your command prompt work?

In other words, what happens when you copy and paste the the following to a prompt?

c:\Python27\Scripts\pygmentize.exe -l sql -f html -O cssclass=mw-highlight,encoding=utf-8
Quinnj09 (talkcontribs)
MarkAHershberger (talkcontribs)

What happens if you use

c:\Python27\Scripts\pygmentize.exe -l sql -f html -O cssclass=mw-highlight,encoding=utf-8 < NUL

or just press Ctrl-Z after the command hangs?

MarkAHershberger (talkcontribs)

If the command returns, that indicates that it is waiting for input on STDIN.

Quinnj09 (talkcontribs)

Ctrl-Z isn't a suitable command, think you mean Ctrl-C, which returns:

Traceback (most recent call last):

  File "C:\Python27\Lib\", line 174, in _run_module_as_main

    "__main__", fname, loader, pkg_name)

  File "C:\Python27\Lib\", line 72, in _run_code

    exec code in run_globals

  File "c:\Python27\Scripts\pygmentize.exe\", line 9, in <module>

  File "C:\Python27\lib\site-packages\pygments\", line 543, in main

    return main_inner(popts, args, usage)

  File "C:\Python27\lib\site-packages\pygments\", line 402, in main_inner

    code =

Running the second command with < Nul gives me:

<div class="mw-highlight"><pre><span></span>


MarkAHershberger (talkcontribs)

No, I mean Ctrl-Z which in MS OS is like Ctrl-D on Unix. But it looks like you need Ctrl-Z and then return, not just Ctrl-Z by itself.

Anyway, this shows that it is set up to read from STDIN and MediaWiki isn't set up to send the input in the MS world in the correct way. I think the bug you found is the right place to put this information.

Quinnj09 (talkcontribs)

Yeh it is that bug, and I've tried the 'workaround', but like @Daimona Eaytoy found, isn't a complete solution, as another problem pops out: the process starts running, but never stops

Reply to "pygmentize not working"
Quinnj09 (talkcontribs)

I think this issue is the encoding? feel free to educate me...

The URL is showing up as: http://mysite/wiki/Category%3AMyGames

When it should be: http://mysite/wiki/Category:MyGames

How can I fix this?

I am running mediawiki 1.31.0

MarkAHershberger (talkcontribs)

This wiki ( doesn't have URLS like that, so, yeah, probably something with encoding.

It looks like you are using "pretty" URLs. What webserver are you using and how is it set up?

Quinnj09 (talkcontribs)


Windows Server 2008

IIS 6.1


$wgScriptPath = "/wiki";
$wgArticlePath = "/wiki/$1"; # tells MediaWiki how IIS will be rewriting URLs
$wgUsePathInfo = true;

IIS > Rewrite Rule (in web.config):

<?xml version="1.0" encoding="UTF-8"?>
                <rule name="RedirectUserFriendlyURL1" stopProcessing="true">
                    <match url="^index\.php$" />
                        <add input="{REQUEST_METHOD}" pattern="^POST$" />
                        <add input="{QUERY_STRING}" pattern="^title=(<nowiki>[^=&amp;amp;]</nowiki>+)$" />
                    <action type="Redirect" url="{C:1}" appendQueryString="false" />
                <rule name="RewriteUserFriendlyURL1" stopProcessing="true">
                    <match url="^([^/]+)/?$" />
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    <action type="Rewrite" url="index.php?title={R:1}" />
Ciencia Al Poder (talkcontribs)

This is a problem with IIS, which requires colons in URL to be encoded, because of how Windows generally handle colons in paths (C: means C is the drive letter, for example). If you dont't want this, you'll need to use a different webserver like Apache, or even use a Linux server.

Quinnj09 (talkcontribs)

I was about to update my post to note that this problem exists even without ShortURL being used.

So there's no way at all to 'fix' this whilst still using IIS?

Unfortunately changing to a different web server is not an option for us (this decision is outside of my control)

MarkAHershberger (talkcontribs)

Solution that someone else found for the problem: Just above <system.webServer> put:

    <!-- Default <,>,*,%,&,:,,? or %u003c,%u003e,%u002a,%u0025,%u0026,%u003a,%u005c,%u003f -->
    <httpRuntime requestPathInvalidCharacters="%u003c,%u003e,%u002a,%u0025,%u0026,%u005c,%u003f" />
Quinnj09 (talkcontribs)

Tried this but doesnt seem to be working.

MarkAHershberger (talkcontribs)

did you try restarting IIS? or rebooting? (I'm not at all familiar with IIS, so that is the end of my helpfulness.... sorry.)

Quinnj09 (talkcontribs)

Yeh I did :(

Thats for trying though, I might do some more searching on the internet next week, I think your onto something.

Reply to "URL Decoding issue"

Category links not updating automatically, not solved by job queue

Wiki Noob2016 (talkcontribs)

I installed MediaWiki from the docker official container ( in a Google Cloud VM running Debian. All appears to be working fine, except that the category links are not updating (i.e., when I add or change categories or some pages' categories, these changes are not recognized by the indexes of pages within categories). If I run refreshLinks.php, all is updated fine.

I read in other posts that a possible reason could be the job queue (StackOverflow Q, on mw.o here, Special:Whatlinkshere and file usage aren't being updated). So I changed $wgJobRunRate to 10, set $wgRunJobsAsync to false, and ran runJobs.php, but it did not change the behaviour. If I make changes to the pages' categories, the showJobs.php will say that I have 0 jobs in queue, but the categories would be wrong. I run refreshLinks.php, and the categories are fixed.

Used versions are: Mediawiki 1.31.0; PHP 7.2.8; SQLite 3.20.1; ICU 57.1.

I appreciate your help to get the usual behavior of links are automatically updating, so I don't have to keep running refreshLinks.php.

MarkAHershberger (talkcontribs)

$wgJobRunRate is meant to be set to a number between 0 and 1, inclusive. Try setting it to 1.

Wiki Noob2016 (talkcontribs)

Set $wgJobRunRate to 1. Still not updating. I tried in a new VM and the issue reproduces.

Ciencia Al Poder (talkcontribs)

A faulty extension might be breaking when you save the page, saving the page but not inserting the necessary jobs to update the links. Set up logs and php error reporting and try saving the page again, and see if there's some error popping up. (check Manual:How to debug)

Reply to "Category links not updating automatically, not solved by job queue"

Transcluding text in an ordered/unordered list breaks if the translcluded page uses <noinclude>

6 (talkcontribs)

I have a problem using templates in lists. I am by no means a power user or wiki guru, so perhaps I am doing something fundamentally wrong. But here's the deal:

I can define a template and then include that template in a simple ordered or unordered list, like this:

  1. Template text
  2. regular text
  3. ...

so if my Template:template_text has "foo" then I get

1. foo 2. regular text 3. ...

BUT if Template:template_text contains category code, the list breaks. E.g.,

Template:template_text foo [[Category:bar]]

then I get 1. foo

1. regular text 2. ...

This is because the generated html now ends the list tag for the template text:

<ol><li> foo
<p><br />
<ol><li> Regular text
<li> ...

(It also sticks in the paragraph and break tags to be even more annoying).

I've tried the tag but that doesn't help.

It's not the end of the world but unless I'm doing something stupid this seems like an annoying bug, as it prevents me from putting my text fragments in categories, which is a really nice thing. (talkcontribs)

Sorry, guess I can't edit my own posts:

In the first example above my wiki code looks like:

# {{Template:template_text}}
# regular text
# ... (talkcontribs)

Ok REALLY sorry for the noise. Upon further testing, I'm pretty sure it is the "noinclude" tag that is causing the problem. Everything I said above is correct but the issue is that having the

[[Category: My Cat]]

section in my template causes lists to break when those lists transclude that template.

Sorry I can't provide a link, as our wiki instance is behind a firewall. (talkcontribs)

Ok never mind. Sorry, I recreated the template and the problem went away. I must have had tabs or line breaks or something in the original template text that was confusing the html parser.

My bad for not thoroughly testing this before whining.

Ron Barker (talkcontribs)

Hi You can edit your own posts. Click on 'More' on the righthand side near the 'reply button'

Jjjjjjjjjj (talkcontribs)
Reply to "Transcluding text in an ordered/unordered list breaks if the translcluded page uses <noinclude>" (talkcontribs)

I started using media wiki last year, now something happened and i can't see my pages, i had important pages there, where are they ? help please !!

2001:16B8:1065:5C00:902:2C64:5806:702 (talkcontribs)

Pages don't get lost, if nothing happened.

What is "something" that happened?

And what exactly do you mean with "cannot see" the pages? What is it that you do see instead?

Reply to "Lost my pages"

title attribute bug

Summary by MarkAHershberger

reported task T160186.

Nicole Sharp (talkcontribs)
Ciencia Al Poder (talkcontribs)

I've reported task T160186. I was able to reproduce it on my installation on several versions (and current master) but unable to reproduce on

Nicole Sharp (talkcontribs)
Appalachian Mountains

Thanks! I just found another weird bug:

[[image:AppalachianLocatorMap2.png|thumb|[[wikipedia:Appalachian Mountains|Appalachian Mountains]] [] ]]

Unless that extra space is in there at the end, MediaWiki will not numberize the hyperlink, but that also doesn't seem to be replicated on Nicole Sharp (talk) 18:19, 10 March 2017 (UTC)

Izno (talkcontribs)

If you're still hanging around, what is your TidyConfig? I've closed the task in phab as invalid as I would guess you don't have Tidy turned on as expected.

Reply to "title attribute bug"

BlueSpice (Help Section, how to edit, change, remove)

The.oneguyaz (talkcontribs)

Hello everyone, I inherited a wiki with the free version of bluespice, there is a HELP, section where there are links to bluespice wiki, etc, does anyone know how to remove or edit the links?


MarkAHershberger (talkcontribs)
Reply to "BlueSpice (Help Section, how to edit, change, remove)"