Jump to content

Project:Support desk

Add topic
From mediawiki.org
Latest comment: 44 minutes ago by Speravir in topic Gadget for auto numeration and Vector-2022
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 "Add topic".

Creating custom skins

[edit]

Hello. I have a custom CSS (also JS but not entirely mine) for the Vector 2022 skin as I find it terrible at its default, but CSS restricts me to narrow customizations as I can't change the HTML structure, and I think changing the HTML structure with JS that much without causing big problems would be very hard as it will be done over an existing structure (even the CSS side causes many hard-to-solve problems for the same reason). Also, the updates the skin gets can break my customizations, very annoyingly. So, I want to create my own MW skins and use them in WMF wikis. How can I do that without too much difficulty? RuzDD (talk) 18:25, 10 February 2025 (UTC)Reply

@RuzDD Manual:How to make a MediaWiki skinTheDJ (Not WMF) (talkcontribs) 16:10, 11 February 2025 (UTC)Reply
Thanks, I will write here if I have problems. RuzDD (talk) 19:40, 11 February 2025 (UTC)Reply
@TheDJ The links I saw don't help, how can I install or enable intl? RuzDD (talk) 19:56, 11 February 2025 (UTC)Reply
@RuzDD Basic (web) development knowledge is required for those who want to develop skins, there is no 'easy' way to learn how to develop skins. Maybe ask AI to help you if you still need to learn. I'm not sure what prompted you to ask about intl, but most likely it refers to php intl, which are additional features for php itself, that you have to enable or install for you PHP install. —TheDJ (Not WMF) (talkcontribs) 09:09, 12 February 2025 (UTC)Reply
@TheDJ I got an error message saying I need to install or enable intl, but these pages don't tell how can I install or enable it in XAMPP's Apache. I already have basic web developement knowledge. Can you help me for installing or enabling php intl in XAMPP's Apache? RuzDD (talk) 10:51, 12 February 2025 (UTC)Reply
https://www.google.com/search?q=php+intl+in+XAMPP%27s+Apache&client=safari&sca_esv=0fc7dd398656b67a&source=hp&ei=0JGsZ_XIAZaI9u8Pxp-amQI&iflsig=ACkRmUkAAAAAZ6yf4ASJVi6QszO4AkILzyDjydPwh0QF&ved=0ahUKEwj18LGfj76LAxUWhP0HHcaPJiMQ4dUDCBE&oq=php+intl+in+XAMPP%27s+Apache&gs_lp=Egdnd3Mtd2l6IhpwaHAgaW50bCBpbiBYQU1QUCdzIEFwYWNoZTIHECEYoAEYCjIHECEYoAEYCkj2EFAAWABwAHgAkAEAmAFloAFlqgEDMC4xuAEMyAEA-AEC-AEBmAIBoAJrmAMAkgcDMC4xoAeuAw&sclient=gws-wizTheDJ (Not WMF) (talkcontribs) 12:20, 12 February 2025 (UTC)Reply
I uncommented ";extension=intl" (there was no ";extension=php_intl.dll") in php.ini and looks like it worked, thanks. I will write here if I have another problem. RuzDD (talk) 14:00, 12 February 2025 (UTC)Reply
I got this error:
Cannot access the database: :real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES).
Check the host, username and password and try again. If using "localhost" as the database host, try using "127.0.0.1" instead (or vice versa).
I tried both but they don't work. (I ran XAMPP as admin and both Apache and MySQL are running.) What can I do @TheDJ? RuzDD (talk) 14:12, 12 February 2025 (UTC)Reply
I solved this problem and completed the installation and I will write here again if I have a problem creating the skin. RuzDD (talk) 13:06, 13 February 2025 (UTC)Reply
@TheDJ The page you linked first tells three ways, but I don't know anything about the mustache templates or whatever gives the data. To clarify, with my current knowledge, I can make an HTML structure giving the look of the skin but can't make the skin show any data. Can you please help me about that? RuzDD (talk) 13:49, 13 February 2025 (UTC)Reply
@wargo Can you help me about that? RuzDD (talk) 18:08, 23 February 2025 (UTC)Reply
Note: A bot archived this topic disruptively and I undid it. RuzDD (talk) 14:22, 10 March 2025 (UTC)Reply
Not disruptive at all - the bot archives discussions that have been untouched for two weeks, so is working as designed. I think you've exhausted the knowledge and willingness to engage of the regulars here so leaving this discussion unarchived will be futile, but whatever. * Pppery * it has begun 16:15, 10 March 2025 (UTC)Reply
@Brooke Vibber Can you help me about that? RuzDD (talk) 16:10, 22 March 2025 (UTC)Reply
@RuzDD I want to create my own MW skins and use them in WMF wikis Before you go any further or spend any more time on this you should know that this is basically impossible. To get a skin deployed on the WMF servers you need to a) Find a team of developers within the WMF who are willing to sponsor the skin and offer tech support and bug fixes b) show that there is a community consensus across multiple projects that this skin should be installed c) write the extension to a professional standard and following WMF coding conventions and best practices d) pass a security review and e) pass a usability review. See Writing an extension for deployment
I think you are going to struggle at every step of this process. a) The WMF does not have enough developers to look after all the extensions currently installed - you are really going to struggle to find a team willing to take stewardship of this skin. The WMF has also been very reluctant to support more skins, as it makes development and testing more difficult. b) Unless your skin meets a demand from multiple projects I think you are going to struggle to get a community consensus to install it. c) I hope this doesn't come across as rude, but if you are struggling to install the PHP development environment and don't know what templates are I doubt the code you write is going to be usable in a production environment. d) the security review process is extremely backlogged - there are several extensions that have been waiting for over a year for a review, see also my comments on c). d) Unless you have some experience with web design I think it is unlikely that your skin will pass a usability review - does the skin work across a variety of browsers and devices? Is the HTML it produces valid and semantically correct? Is it accessible to things like screen readers? Would it be easy for other people using the skin to figure out where everything is?
If these customisations are just for you to use then writing a new skin is fundamentally the wrong approach. Using user scripts and CSS is probably the best approach, if that doesn't offer enough customisation perhaps look into writing a standalone app and fetching the data you need from the API? 86.23.109.101 11:08, 28 March 2025 (UTC)Reply
Thank you. I think writing a standalone frontend and fetching the data from the API might be best option for now, any guides or help about this? And can't an operation be started to make the content-side stylings flexible for customizations (as being designed so that different stylings including fonts, content area BG / box BG / text colors, borders, shadows, and margins / paddings can be directly applied without breaking anything, just as being controlled entirely by the skin)? RuzDD (talk) 15:15, 29 March 2025 (UTC)Reply
any guides or help about this? There's a load of documentation on the APIs available at API, you probably want to use the rest API to build your app, see https://en.wikipedia.org/api/rest_v1/ for the WMF specific version, or API:REST API/Reference for the general Mediawiki one.
can't an operation be started to make the content-side stylings flexible for customizations ... it should be possible to customise the site design with JavaScript, but you need to do it in the right way. Stable interface policy/Frontend tells you which bits of the interface are considered to be stable (and should therefore be safe to target with JavaScript or CSS) and which bits are not. Generally you should use the mw JavaScript object to make your modifications (see https://doc.wikimedia.org/mediawiki-core/master/js/mw.html). 86.23.109.101 07:47, 31 March 2025 (UTC)Reply
Thank you. I'll further look at these and related stuff when I have time. RuzDD (talk) 18:05, 12 April 2025 (UTC)Reply

Embedding a Google Form into my Miraheze wiki page

[edit]

Need permissions to embed HTML on your wiki page. I tried to embed HTML code generated for my GOOGLE Form. But it's not working. Please help. Jeetudas (talk) 19:03, 3 April 2025 (UTC)Reply

You could try Extension:Widgets. Jonathan3 (talk) 20:24, 3 April 2025 (UTC)Reply
Afraid not. Widgets has been disabled on MH since late December 2020 over security concerns. The only way out is through highly intricate custom JS on your own domain, which not everyone (this wiki-veteran included!) has prolonged experience or confidence with. --Slgrandson (talk) 01:41, 18 April 2025 (UTC)Reply
Thanks. I'd not heard about that, but am currently using the Widgets extension on my own wiki. I've asked for further details on the extension talk page: https://www.mediawiki.org/wiki/Extension_talk:Widgets#Extension_update_since_Miraheze_%222020-12-23_Security_Disclosure%22? Jonathan3 (talk) 20:17, 24 April 2025 (UTC)Reply
@Jeetudas For security reasons only specific bits of HTML are allowed to be used in wiki pages, see Help:HTML in wikitext. You would need to ask the Miraheze system administrators for help, though I suspect they will not allow this for security reasons. Could you not just provide a link to the form? 86.23.109.101 12:55, 4 April 2025 (UTC)Reply

Translating is not working

[edit]

Hello support

I have created a page "Test08" in my wiki and i have translated this page into hindi as Test08/hi. But when i am going to access this translated page its not showing into translated page and showing this message

Test08/hi

Jump to navigationJump to search

There is currently no text in this page. You can search for this page title in other pages, search the related logs, or create this page.


But i have translated this page.

i have done all the neccessary configuration in the Mediawiki but translated page is not showing.

Please suggest what is the issue.

Thanks Gaurav.singhEbizon (talk) 14:20, 8 April 2025 (UTC)Reply

Please see "Post a new question" above and provide basic info. Which exact version of the Translate extension is installed (see the Special:Version page)? What does "i have done all the neccessary configuration in the Mediawiki" mean exactly, without paraphrasing? Malyacko (talk) 16:30, 8 April 2025 (UTC)Reply
Hello @Malyacko
I am using Translate version this "version": "2022-01-19". I think version is not issue because i am using the same version in my other website and translate is working fine in this website.
I am using following version of the MediaWiki and php
MediaWiki- 1.38.2
Php - 8.3.17
I have done all the necessary configuration in LocalSettings.php file.
Please solve and suggest how can i solve this my translate issue Also suggest how can i debugg the issue.
Thanks Gaurav.singhEbizon (talk) 12:21, 9 April 2025 (UTC)Reply
Hi @Malyacko
Any update on this matter?
Thanks Gaurav.singhEbizon (talk) 08:39, 11 April 2025 (UTC)Reply
Hello @Malyacko
I have done the same action on the old and the new site and below are the page creation logs. The thing is that it does not create the Test11/es part.
Version page is listed below
New site ( Not working)
10:27, 11 April 2025 FuzzyBot talk contribs created page Test11/en (Updating to match new version of source page)
10:27, 11 April 2025 FuzzyBot talk contribs created page Translations:Test11/1/en (Importing a new version from external source)
10:27, 11 April 2025 FuzzyBot talk contribs created page Translations:Test11/Page display title/en (Importing a new version from external source)
10:26, 11 April 2025 Wim talk contribs created page Translations:Test11/1/es (Created page with "Hola")
10:26, 11 April 2025 Wim talk contribs created page Translations:Test11/Page display title/es (Created page with "Testos11")
10:25, 11 April 2025 Wim talk contribs created page Test11 (Created page with "<translate> Hello </translate>")
Old site (working)
10:34, 11 April 2025 Wim talk contribs created page Translations:Test11/1/es (Created page with "Hola")
====> 10:34, 11 April 2025 Wim talk contribs created page Test11/es (Created page with "Testos11")
10:34, 11 April 2025 Wim talk contribs created page Translations:Test11/Page display title/es (Created page with "Testos11")
10:34, 11 April 2025 FuzzyBot talk contribs created page Test11/en (Updating to match new version of source page)
10:34, 11 April 2025 FuzzyBot talk contribs created page Translations:Test11/1/en (Importing a new version from external source)
10:34, 11 April 2025 FuzzyBot talk contribs created page Translations:Test11/Page display title/en (Importing a new version from external source)
10:33, 11 April 2025 Wim talk contribs created page Test11 (Created page with "<translate> Hello </translate>")
Installed software
Product     Version
MediaWiki     1.38.2
PHP     8.3.20 (fpm-fcgi)
MySQL     8.0.41-0ubuntu0.24.04.1
ICU     74.2
Elasticsearch     6.8.23 86.95.34.245 11:24, 11 April 2025 (UTC)Reply

LocalSettings.php

[edit]

Hallo, in der neuesten Version 1.43.1 wird die LocalSettings.php in diesem Bereich

## The URL paths to the logo.  Make sure you change this from the default,

## or else you'll overwrite your logo when you upgrade!

$wgLogos = [

'1x' => "$wgResourceBasePath/resources/assets/change-your-logo.svg",

'icon' => "$wgResourceBasePath/resources/assets/change-your-logo.svg",

];

fehlerhaft ausgegeben, indem der Passus in eckige Klammern gesetzt ist und die Darstellung des Favicon behindert.

Regards Klaus 91.52.223.141 07:41, 11 April 2025 (UTC)Reply

Nach ⚓ T391673 1.43.1 LocalSettings.php logo/icon section displayed incorrectly verlagert !

Regards Klaus

Safe to clear mw_objectcache?

[edit]

I am encountering the known bug with sessions data loss when setting $wgMainCacheType to CACHE_ACCEL. I added $wgSessionCacheType = CACHE_DB; to store the session data in the database to go around this issue. Now I am wondering if I should clear the table mw_objectcache to remove old cache which should now be handled by APCu. I don't really mind to log out all users with this move, but I could also just delete all non-session files. Is this safe to do? Or is it maybe unnecessary 'cause it'll clear itself over time? I had $wgMainCacheType set to CACHE_NONE for years until now. DonnyPro (talk) 12:00, 11 April 2025 (UTC)Reply

Trailing zeroes in output

[edit]

Is there a way to fix the number of fractional digits, including trailing zeroes, in parser function output? In particular I would like to keep trailing zeroes from #expr. Ham Pastrami (talk) 08:26, 12 April 2025 (UTC)Reply

Give us an example :-) Jonathan3 (talk) 22:21, 13 April 2025 (UTC)Reply

foreach error from MimeAnalyzer

[edit]

The error log on my wiki's server has lately been filled with constant repetitions of this PHP error, always citing MimeAnalyzer:

PHP Warning: foreach() argument must be of type array|object, string given in /var/www/my.wiki/public_html/mediawiki-1.43/includes/libs/mime/MimeAnalyzer.php on line 129, referer: https://my.wiki/Some_article

I see the line it references in MimeAnalyzer.php is in this block:

foreach ( $this->mimeToExts as $mime => $exts ) {
    foreach ( $exts as $ext ) {
        $this->extToMimes[$ext][] = $mime;
    }
}

I'm not sure how to diagnose this, so I was curious if anyone might know the cause. Any insights are much appreciated!

System details:

Product Version
MediaWiki 1.43.0
PHP 8.3.19 (apache2handler)
ICU 66.1
MySQL 8.0.33
Pygments 2.17.2
Lua 5.1.5

Huwmanbeing (talk) 13:04, 12 April 2025 (UTC)Reply

[edit]

neartitle:"San Francisco" nearcoord:37.776,-122.39

what's the default distance in these search examples from Help:CirrusSearch#Geo_Search? for https://commons.wikimedia.org/ . RoyZuo (talk) 07:09, 14 April 2025 (UTC)Reply

[RESOLVED] Sortable tables no longer working?

[edit]

In my wiki, sortable tables have stopped sorting---clicking on the arrows in the header does nothing. They certainly worked in the past, and I have no idea when exactly this happened. Sortable tables work fine in wikipedia and in this wiki. Looking for some ideas on what's wrong.

My wiki: https://horawiki.org/

Example failing page: https://horawiki.org/page/Original_Music (but AFAIK sortable tables fail everywhere)

MediaWiki version: 1.42.3

Browsers tested: Brave, Safari

Larrydberg (talk) 20:47, 14 April 2025 (UTC)Reply

There are some errors there (e.g. typing F12 on Chrome). The second URL gives details of this error: Error: Class "ResourceLoaderModule" not found. https://horawiki.org/load.php?lang=en-gb&modules=startup&only=scripts&raw=1&skin=vector. I don't know the answer though. Maybe it would be worth checking your skin is up to date, or downloading the MediaWiki core files again? Jonathan3 (talk) 00:27, 15 April 2025 (UTC)Reply
Many thanks, Jonathan3. From the backtrace I found that ResourceLoaderModule, which was deprecated in 1.39 and completely removed in 1.42, was still being used in the (old) version of UniversalLanguageSelector that I had. Updating that extension fixed everything. (Tracing the connection between ULS and sortable tables is more than I care to handle, but no doubt it's just order of loading, with ULS aborting before something important gets its turn.) Thanks again. (Now: Not sure what to do about a resolved issue, so I'm just fixing the title.)
Larrydberg (talk) 17:03, 15 April 2025 (UTC)Reply

Syntax when protecting pages for a non-standard length of time

[edit]

I'm a bureaucrat at Wikispecies and an administrator at Swedish Wikivoyage and Wikimedia Sweden (WMSE). When protecting a page on any of those wikis I'm faced with the option to protect it for a fixed period of time (one week, one month, "infinitely" etc.), but there's also an option to chose "Other time" by entering code into a text box. However, I can't seem to find any information about how this command should be formatted, nor anything about the preferred date format and such. I've looked in Help:Protected pages and similar MediaWiki help pages, but struck no luck. (Most Meta-Wiki pages on the subject simply soft-redirects to MediaWiki). Even though protecting pages is (and should be) a fairly rare event, any help would be much appreciated. –Best regards, Tommy Kronkvist (talk), 19:19, 16 April 2025 (UTC).Reply

[edit]

On my Miraheze wiki, the Minerva.js settings currently contain this code:

mw.util.addPortletLink('p-navigation', '/wiki/Special:WhatLinksHere/' + mw.config.get( 'wgPageName' ), 'What links here', 'nav-wlh');

However, it should be quickly noted that "What links here" is invalid for pages in the Special namespace themselves; to that end, I'd like to know exactly what wraparound to use for cancelling it out if special pages are visited. Once I receive a tip (from @Bawolff or otherwise), the same procedure will apply for overviews of related changes.

Still, with Good Friday and Easter weekend close at hand, this might take a little while. --Slgrandson (talk) 01:56, 18 April 2025 (UTC)Reply

@Slgrandson I havent tested, but generally an ISO timestamp will likely work yyyy-mm-dd hh:mm:ss —TheDJ (Not WMF) (talkcontribs) 08:16, 21 April 2025 (UTC)Reply
@TheDJ: If so, which part of the calls is the timestamp appended to? --Slgrandson (talk) 20:58, 21 April 2025 (UTC)Reply

Fediverse Creator meta tag

[edit]

Wiki: https://joinfediverse.wiki Version: 1.41.0

Hi, Mastodon has a feature where you can make sure your profile is linked to with every link to your homepage on the Fediverse. You can see an example here: https://fedi.at/@FediverseFoundation/114065155360271846 On the bottom of the link preview it says "Mehr von Fediverse Foundation" which links back to the same profile that posted the post in that case. I'd like to do that with my wiki's Fediverse profile.

Mastodon's simple instruction is to put the following html code on the website (either in every article or somehow globally):

<meta name="fediverse:creator" content="@JoinFediverseWiki@climatejustice.social">

Where can I put that in my wiki so it will work with every article on the wiki? Do I need an extension for it? PKFP (talk) 18:19, 19 April 2025 (UTC)Reply

@PKFP You can write a hook in your localsettings.php that hooks into something like Manual:Hooks/BeforePageDisplay adding a setMeta to every single pageview. —TheDJ (Not WMF) (talkcontribs) 08:12, 21 April 2025 (UTC)Reply
Hey, thanks for your tip. Could you explain this a bit further? I forwarded it to the tech person for the wiki, but he didn't get it yet. PKFP (talk) 06:26, 24 April 2025 (UTC)Reply
Maybe this would be a suitable addition to Extension:WikiSEO? It might be worth raising a feature request for that (it used to support twitter:creator). Sam Wilson 09:16, 21 April 2025 (UTC)Reply
Thanks, I'll try. PKFP (talk) 06:26, 24 April 2025 (UTC)Reply

How do I change the article content's background color by assigned category?

[edit]

I tried to use Ciencia Al Poder's Snippets/Style pages based on categories, and modified it to work with the article's content background but it didn't work.

I tried something like this:

/** * Adds CSS classes to the body tag based on the categories this page belongs to * * @source * @revision 2016-01-18 */ (function($, mw) { var fn = function() { var cats = mw.config.get('wgCategories'), newClasses; if (cats) { newClasses = $.map(cats, function(el) { return 'cat-' + encodeURIComponent(el.replace(/[ .]/g, '_')).replace(/%/g, '_'); }).join(' '); $(document.body).addClass(newClasses); } }; if (document.body) { fn(); } else { $(fn); } })(jQuery, mw); WongIsNotOK (talk) 17:26, 21 April 2025 (UTC)Reply

Quickstart

[edit]

I just became an interface administrator of Tagalog Wiktionary. The only admin before me has been very inactive in the site for around a decade now. I'm now lost. I want to begin with UI changes but the MediaWiki FAQ says I should have SSH access or something but how do I have those? How do I run automation bots as well? And how do I know the mediawiki version of the site? Can I upgrade it? Ysrael214 (talk) 11:09, 23 April 2025 (UTC)Reply

SSH access is mainly a means to upgrade the MediaWiki software when it's running on a remote server. Fortunately you don't need any of that because the WMF takes care of upgrades for you. To check the version of MediaWiki you're working with you take a look in Special:Version. For bots, see Manual:Bots. Being an interface admin, I presume you also want to take a look at Manual:CSS and probably to the CSS code used by other chapters of Wiktionary. Tactica (talk) 00:02, 24 April 2025 (UTC)Reply

Diff API for comapring 2 texts (not existing pages)?

[edit]

I'm writing a userscript for editing a page. I let users compose text before saving. So I want to compare 2 text (multi-row) strings with the MW's internal diff logic as it is better than other open source libraries.

How can I pass two text strings to the Diff API? All I found is API:Compare which requires existing pages. Subfader (talk) 13:31, 24 April 2025 (UTC)Reply

Discussion at Extension_talk:CategoryTree#Suppressing_"no_subcategories"

[edit]

 You are invited to join the discussion at Extension_talk:CategoryTree#Suppressing_"no_subcategories". Sdkbtalk 18:45, 24 April 2025 (UTC)Reply

DNS Blacklist issues

[edit]

Hello. I have been using DNS Blacklist URLs on my wiki to combat spam, and I also have the ConfirmAccount extension installed and enabled on my wiki family. However, I still get account requests from spambots.

Here is the code that I added to my Localsettings.php file:

$wgEnableDnsBlacklist = true; $wgDnsBlacklistUrls = array( 'xbl.spamhaus.org.', 'zen.spamhaus.org.', 'dnsbl.tornevall.org.', 'spam.dnsbl.sorbs.net.', 'rbl.dnsbl.im.', 'noptr.spamrats.com.', 'all.s5h.net.', 'z.mailspike.net.' );

Is there something wrong with the DNS blacklist configuration? Does this feature only affect editing from the blacklisted IPs? If there is something wrong, then how do I fix it? Thank you for reading. Newman2 (talk) 20:48, 24 April 2025 (UTC)Reply

Gadget for auto numeration and Vector-2022

[edit]

Hello, the auto numeration activated with MediaWiki:Gadget-autonum.css and MediaWiki:Gadget-autonum.js (I load them in my global.js) does not work well together with Vector-2022 skin, because the counter reset does not work, and so all lower sections are just counted up. Note, that in vector-2022 only the else tree of the script is active and the code of the CSS is used. If you think, why I do not just ask the author Krinkle – well he wrote almost a year ago “I do not use the autonum gadget myself. For now, I have exceed the time I'm willing to spend on this gadget. I suggest gathering support and awareness of other people in the community, to hopefully find someone who is able and willing to maintain this JS/CSS snippet for further modifications.” (Krinkle’s user talk page on meta, cf. meta:Special:Diff/26715423 or the full conversation at m:Special:PermaLink/26721127#Section autonumeration with Parsoid). As an example: Manual:FAQ (itself not ready for vector-2022, at least the toc part I looked for) has 12 sections, and the latest one has 6 subsections which is fine displayed in (legacy) Vector from 2010, but with Vector 2022 I see the count 12.107. — Speravir (talk) – 00:35, 25 April 2025 (UTC)Reply