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".

1.39 how to setup mobile skin?

3
2003:C2:3F21:FD00:9449:AC0F:F20E:94B7 (talkcontribs)

Mediawiki 1.39.6, PHP 7.4.3, MySQL 8.0.36

wfLoadExtension( 'MobileDetect' );
wfLoadExtension( 'MobileFrontend' );
wfLoadSkin( 'MinervaNeue' );
$wgMFDefaultSkinClass = 'SkinMinerva';
$wgDefaultMobileSkin = 'MinervaNeue';
$wgMinervaEnableSiteNotice = true;
$wgMFAutodetectMobileView = true;
$wgMFEditorOptions = array(
        'anonymousEditing' => false,
        'skipPreview' => false
);


Till 1.35 we used to have MinervaNeue as mobile skin. With 1.39, this doesn't work anymore. Mobile devices apparently use the vector skin. What will i have to do to make the mobile skin work?

The mediawiki logfile is full of thousands of lines which don't say nothing to me, by filtering "mobile" i found one interesting line:

[resourceloader] Module "ext.MobileDetect.mobileonly" not loadable on target "mobile".

???

Bawolff (talkcontribs)

Do you have the correct versions of all your extensions? You need 1.39 version of Minerva and MobileFrontend etc.

2003:C2:3F21:FD00:E5D4:4DFC:FAFA:3692 (talkcontribs)

I am quite sure. MobileDetect 2.2 (fc3a66e) 18:49, 11. Feb. 2024, MobileFrontend 2.4.0 (7dc20b0) 07:36, 4. Mär 2024, MinervaNeue – (d515f6a) 08:24, 29. Apr. 2024

These are the versions I get when using ExtensionDistributor and SkinDistributor using target "1.39"

In the desktop browser, skin MinervaNeue has got the look. After login, of course. On my mobile, the skin is s.th. like vector, whether I am logged in or not. This means even when I select MinervaNeue in my user preferences!

Certainly the problem is sitting here in front of my screen, but I've got no more ideas where to look.

Reply to "1.39 how to setup mobile skin?"

Reinstalled MySQL and can't find a way to put Mediawiki database back in place from backup

2
Giovata (talkcontribs)

I was having trouble with my MySQL installation on an Ubuntu server where I host a Mediawiki. After hours of trying to research how to fix it, it seemed my only choice was to purge remove MySQL and then install it again. Eventually this worked and now MySQL runs correctly again.

Before doing this, I backed up /var/lib/mediawiki and /var/lib/mysql/ by coping those directories. Now that I've reset mysql, I've not been able to figure out a way to put the data back in place using the backup of .frm and .ibm files. I copied them back into place after creating a new empty MySQL database for the wiki, but it doesn't automatically import the data from these files and I can't find much information online that indicates how to do it in a situation like this. Guides for importing a Mediawiki backup all seem related to XML and other formats which I don't have.

I also don't want to fully reset my Mediawiki installation if that's possible, I would just like to configure it (or MySQL) in a way where I can make it work again using the backup files. update.php also can't run due to missing tables, and the wiki itself doesn't currently work at all without the database containing the data it needs.

What can I do to sort this out and make it work again with the pre-existing data?

Bawolff (talkcontribs)
Reply to "Reinstalled MySQL and can't find a way to put Mediawiki database back in place from backup"

Allow account creation only from specific email domains.

6
MarkJurgens (talkcontribs)

I'd like to allow teachers from my school board to create an account on our wiki, but ONLY if they have an email addresses from a specific domain. (Ex. ___@schoolboard.com). The end result would be only teachers from specific school boards would be able to create accounts and edit.

An array to add multiple school board domains would be great.

Any ideas? Thanks!

MarkAHershberger (talkcontribs)

This is easy to do by using the AbortNewAccount hook. Something like the following (untested, but based on code I use):

function abortOnBadDomain($user, &$message) {
	global $wgRequest;
	$allowedDomains = array( "school.edu", "k12.us" );
	$email = $wgRequest->getText( 'wpEmail' );
	$emailSplitList = explode("@", $email, 2);

	if ( isset( $emailSplitList[1] ) ) {
		foreach( $allowedDomains as $domain ) {
			if ( $emailSplitList[1] === $domain ) ) {
				return true;
			}
		}
	}
	$message = "Domain blocked";

	return false;
}
$wgHooks['AbortNewAccount'][] = 'abortOnBadDomain';
MarkJurgens (talkcontribs)

Thanks Mark,

I may have sounded like a programmer in my initial request, and I've got a good handle on configuring Mediawiki, so excuse my ignorance:

Where do I put this code?

On another note, are there a way to find a coder(s) who might want to help me with an educational project? I can float server costs but developer might tank my non-existent budget. :)

Thanks again! P.s. Nice blog.

MarkAHershberger (talkcontribs)

You can put the code at the bottom of your LocalSettings.php file. It should work there. Let me know if you run into problems with it.

I'm not sure how to find a volunteer coder, but you might find someone who has some interest, or who can offer you pointers by writing about your project on mail:mediawiki-l.

Thanks!

FabienAndre (talkcontribs)

Due to the deprecation of AbortNewAccount hook, the previous the previous answer from @MarkAHershberger does not work anymore (so as the EmailDomainCheck extension).

Here is an updated version that you can include in LocalSettings.php (tested on 1.41)

class AllowedDomainPreAuthenticationProvider extends \MediaWiki\Auth\AbstractPreAuthenticationProvider {
    public function testForAccountCreation( $user, $creator, array $reqs ) {
        $allowedDomains = array( "school.edu", "k12.us" );
        $email = $user->mEmail;
        $emailSplitList = explode("@", $email, 2);

        if ( isset( $emailSplitList[1] ) ) {
            foreach( $allowedDomains as $domain ) {
                if ( $emailSplitList[1] === $domain ) {
                    return \StatusValue::newGood();
                }
            }
        }

        $message = "Blocked domain ($emailSplitList[1]). Allowed domains are : " . implode(', ', $allowedDomains);
        return \StatusValue::newFatal($message);
    }
}

$wgAuthManagerAutoConfig['preauth'] = [
    'AllowedDomainPreAuthenticationProvider' => [
        'class' => 'AllowedDomainPreAuthenticationProvider',
        'sort' => 1,
    ],
];
Reply to "Allow account creation only from specific email domains."

implement 2 potentially useful functions

1
185.169.64.46 (talkcontribs)

1. As you will already know, to put a link that shows the logs of a page (let's say the "Example" page), we have to write "https://mediawiki.org/wiki/Special:log?page=Example", "[/mediawiki.org/wiki/special:log?page=example]" or "{{fullurl:special:log|page=example}}", I would suggest that just writing "{{Special:log|page=example}}", instead of ignoring any character after the pipe/vertical bar ("|"), have it (into account) as a parameter separator like "{{Special:Prefixindex/Editnotices|namespace=10|stripprefix=1}}" does, not only on that special log page, but also on any other special page. 2. We can write [[Special:Log/create]] rather than "https://mediawiki.org/wiki/Special:Log/create" or "https://mediawiki.org/w/index.php?title=Special:Log&type=create" to view log of pages created, but with subtypes of a log type cannot use double square brackets, if we want to see the page restoration logs, we have to write obligatory "https://mediawiki.org/wiki/Special:log/delete?subtype=restore" or "{{fullurl:Special:Log/delete|subtype=restore}}", if "delete" or any other type of log (that has subtypes), is not added, the subtype is simply ignored, but that has nothing to do with this 2nd implementation, I suggest that the system can show the same page logs when instead of having "?subtype=<name of a subtype log>" in the URL it had "/<name of a subtype log>", the shortest URL to display restore logs would be "https://mediawiki.org/wiki/Special:log/delete/restore" instead of "https://mediawiki.org/wiki/Special:log/delete?subtype=restore", so, we could go to that page by just typing "[[Special:log/delete/restore]]" instead of having to type the full URL or using "{{fullurl}}", and furthermore, with that implementation, we could also see Pppery's modified block logs writing "[[Special:Log/block/reblock/Pppery]]" instead of "{{fullurl:Special:Log/block/Pppery|subtype=reblock}}", It would also be valid to write "https://mediawiki.org/wiki/special:log?type=block/reblock"

If they are implemented, we would save ourselves from writing full URLs or using {{fullurl}}

Reply to "implement 2 potentially useful functions"

Subpages Not Allowed?

1
Johnywhy (talkcontribs)

On import, i'm getting

Wrong option: Namespace "(Main)" of the root page does not allow subpages.

How to fix?

Manual:Importing XML dumps

Reply to "Subpages Not Allowed?"

css for Vector-2022

3
2003:C2:3F21:FD00:516D:5391:79D1:A338 (talkcontribs)

Where shall I place my css modifications for the new Vector (2022) skin? I've tried MediaWiki:Vector-2022.css

but it has no effect.

Ciencia Al Poder (talkcontribs)

It may take some time to take effect, usually 20 minutes at most. Otherwise, a syntax error in that page may render the entire CSS or from one point to the end unusable. For example, if you forgot to open or close curly braces. You may want to check if the CSS of that page is valid running it through an online CSS validator.

2003:C2:3F21:FD00:48AC:4A02:818F:D381 (talkcontribs)

Sorry, no, there must be another reason. The same css code works fine as "User:MyUser/vector-2022.css" and does not work as "MediaWiki:Vector-2022.css"

Any other ideas? It is Mediawiki 1.39.6

Reply to "css for Vector-2022"

List of hidden special pages

4
Zhuyifei1999 (talkcontribs)
MarkAHershberger (talkcontribs)

There is this list in SpecialPageFactory.php:

		// Unlisted / redirects
		'Blankpage'                 => 'SpecialBlankpage',
		'Blockme'                   => 'SpecialBlockme',
		'Emailuser'                 => 'SpecialEmailUser',
		'Movepage'                  => 'MovePageForm',
		'Mycontributions'           => 'SpecialMycontributions',
		'Mypage'                    => 'SpecialMypage',
		'Mytalk'                    => 'SpecialMytalk',
		'Myuploads'                 => 'SpecialMyuploads',
		'PermanentLink'             => 'SpecialPermanentLink',
		'Redirect'                  => 'SpecialRedirect',
		'Revisiondelete'            => 'SpecialRevisionDelete',
		'Specialpages'              => 'SpecialSpecialpages',
		'Userlogout'                => 'SpecialUserlogout',
104.218.129.50 (talkcontribs)

You forgot Special:Mobile languages and Special:MyLanguage.

Reply to "List of hidden special pages"

Unable to Delete Files

2
72.23.146.10 (talkcontribs)

Howdy,

I'm trying to delete some duplicated images, but keep getting the following error:

Error deleting file: An unknown error occurred in storage backend "local-backend".

The images in question all have previous versions that, for one reason or another, show "No thumbnail" as their first version (despite those thumbnails existing previously, prior to new versions being uploaded). Images that don't have "No thumbnail" as their first record can be deleted without issue.

My biggest question is, is there a way to bypass this error and delete the files? Less importantly, what can cause the "No thumbnail" issue to happen? The wiki I'm working on has lost a lot of prior versions of images over the years and no one can pinpoint why, or how to prevent it from happening in the future.

TheDJ (talkcontribs)

Most often this is due to permissions on the filesystem being incorrect. the webserver deamon and the permissions of the directory have to be compatible.

Reply to "Unable to Delete Files"

Mediawiki S3 Saving error

2
Egg 3846 (talkcontribs)

Hi,

Can you help me debug some mediawiki + S3 compatible service errors ? ( image resize / uploads )


It's an error i have on my server but not locally, but i haven't found any obvious difference between the setup yet


I'm using the following :

- mediawiki 1.39.6 ( a canasta image : canasta:1.39.6-20240104-346 )

- AWS extension 0.12.0

- minio


My FileOperation log :


2024-05-03 15:57:57 9de13bf397d2 mediawiki: S3FileBackend: found backend with S3 buckets: mediawiki, mediawiki/thumb, mediawiki/deleted, mediawiki/temp.

2024-05-03 15:57:57 9de13bf397d2 mediawiki: S3FileBackend: doPrepareInternal: S3 bucket mediawiki, dir=temp/4/42, params=noAccess, noListing, dir

2024-05-03 15:57:57 9de13bf397d2 mediawiki: S3FileBackend: doSecureInternal: creating temp/.htsecure in S3 bucket mediawiki

2024-05-03 15:57:57 9de13bf397d2 mediawiki: S3FileBackend: exception [Null] in doSecureInternal from PutObject ({"Bucket":"mediawiki","Key":"temp/.htsecure","Body":"","@http":[],"@context":[]}): Error executing "PutObject" on "xxxx:9000/mediawiki/temp/.htsecure"; AWS HTTP error: Client error: `PUT xxxx:9000/mediawiki/temp/.htsecure` resulted in a `404 Not Found` response:

<HTML><HEAD>

<TITLE>Network Error</TITLE>

</HEAD>

<BODY>

<FONT face="Helvetica">

<big><strong></strong></ (truncated...)

Unable to parse error information from response - Error parsing XML: String could not be parsed as XML

2024-05-03 15:57:57 9de13bf397d2 mediawiki: S3FileBackend: doCreateInternal(): saving temp/4/42/20240503155757!phpp5WIrX.jpg in S3 bucket mediawiki (sha1 of the original file: jlb3z7ca9kw98dqons8c4pfh0sgo92m, Content-Type: image/jpeg)

2024-05-03 15:57:58 9de13bf397d2 mediawiki: S3FileBackend: exception [Null] in createOrStore from PutObject (false): Error executing "PutObject" on "xxxx:9000/mediawiki/temp/4/42/20240503155757%21phpp5WIrX.jpg"; AWS HTTP error: Client error: `PUT xxxx:9000/mediawiki/temp/4/42/20240503155757%21phpp5WIrX.jpg` resulted in a `404 Not Found` response:

<HTML><HEAD>

<TITLE>Network Error</TITLE>

</HEAD>

<BODY>

<FONT face="Helvetica">

<big><strong></strong></ (truncated...)

Unable to parse error information from response - Error parsing XML: String could not be parsed as XML

2024-05-03 15:57:58 9de13bf397d2 mediawiki: S3FileBackend: Performance: 0.127 second spent on: uploading temp/4/42/20240503155757!phpp5WIrX.jpg to S3

2024-05-03 15:57:58 9de13bf397d2 mediawiki: StoreFileOp failed: {"src":"/tmp/phpp5WIrX","dst":"mwstore://AmazonS3/local-temp/4/42/20240503155757!phpp5WIrX.jpg","overwrite":true,"headers":[],"failedAction":"attempt"}

Bawolff (talkcontribs)

The 404 responses make me wonder if the domain/port for the s3 bucket is set correctly.

Reply to "Mediawiki S3 Saving error"

How to change the pages / hide the install config pages from main page

3
Bananatree88 (talkcontribs)

I am sorry for all the stupid questions - I see on the main page it shows how to configure etc even if you are not an admin - how can you change that and have the pages / topics created show on the main page?

Ciencia Al Poder (talkcontribs)

If by pages / topics you mean actual pages, you can transclude Special:NewPages as {{Special:NewPages/25}}

Alternatively, use a proper forum software instead of MediaWiki.

Bawolff (talkcontribs)

Dont worry about stupid qusstions. Its what we are here for.

Reply to "How to change the pages / hide the install config pages from main page"