Project:Support desk

Jump to navigation Jump to search

About this board

Welcome to the MediaWiki Support desk, where you can ask MediaWiki questions!

(Read this message in a different language)

See also

Other places to ask for help:

Before you post

Post a new question

  1. To help us answer your questions, please indicate which versions you are using, as found on your wiki's Special:Version page:
    • MediaWiki version
    • PHP version
    • Database type and version
  2. 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.
  3. To start a new thread, click "Start a new topic".
51.148.133.34 (talkcontribs)

Hi, I have MediaWiki installed on my hosting and I know very little about how to configure and use it as a collaborative documentation tool for my group of circa 50 users.


Please could you signpost some good tutorials which cover post installation configuration and howto use?


thank you,

Paul kirk

Ammarpad (talkcontribs)
51.148.133.34 (talkcontribs)

many thanks for your help

Paul

Reply to "Tutorial for beginners"

Problem with chromium/webkit browsers and login

8
VSN-Herman (talkcontribs)

Hello, I am new and inexperienced with Mediawiki and run into 2 problems I can't figure out.

The site in question is https://vsnwiki.nl, Mediawiki version 1.35.1, PHP 7.4.16 (litespeed), MariaDB 10.3.28-MariaDB-log-cli-Inv, ICU 64.2.

Question 1. The site is not displayed via chromium or webkit (Safari) based browsers ?

Question 2. When you want to request an account to log in, you get an error message:

" [YG-RL@vo7LMO5jLZkCtKBwAAEA8] /index.php/Speciaal:GebruikerAanvragen Wikimedia\Rdbms\DBQueryError from line 1699 of /home/vsnbasf/domains/vsnwiki.nl/public_html/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?


Error 1146: Table 'vsnbasf_mw1.mw_account_requests' doesn't exist (localhost)

Function: ConfirmAccount::runAutoMaintenance

Query: SELECT acr_id,acr_storage_key FROM `mw_account_requests` WHERE (acr_rejected < '20210402035944') "


I tried to use the application's database schema updater after upgrading, but maybe I did something wrong ? I do not know and as already written I am very inexperienced. I added lines to localsettings.php and possibly made an error ? That could very well be the case. A mistake could have crept in there, too. The rules I added are:


$wgSitename = "Wiki van Vrij en Sociaal Nederland";

$wgGroupPermissions['user']['userrights'] = false;

$wgLogo = "{$wgScriptPath}/resources/assets/Vrij_en_Sociaal_Nederland_logo.jpg";

$wgGroupPermissions['*']['edit'] = false;

$wgGroupPermissions['*']['createaccount'] = false;

wfLoadExtension( 'ConfirmAccount' );

require_once "$IP/extensions/ConfirmAccount/ConfirmAccount.php";

$wgConfirmAccountContact = 'Bureaucrat@domain.com';

$wgGroupPermissions['bureaucrat']['confirmaccount-notify'] = true;

$wgConfirmAccountContact = "info@vsnwiki.nl";

$wgShowExceptionDetails = true;

require_once "$IP/extensions/MobileDetect/MobileDetect.php";

wfLoadExtension( 'VisualEditor' );


Hopefully 1 of you can help me with this ? And best regards,

Herman

Bawolff (talkcontribs)

For error 1, please be more specific as to what happens.


For error 2, try running update.php again. Some extensions require you rerun it after adding them, including ConfirmAccount

VSN-Herman (talkcontribs)

Hello Bawolff, thanks for your response

About error 1, please see screenshot

About error 2, how do I run update.php in the right and proper way ? I've read all sorts of 'help pages', but don't quite understand how to go about it.

Hopefully you can explain it to me

Problem with display by Chromium and webkit (Safari) browsers
Bawolff (talkcontribs)

For error 1, try setting $wgDisableOutputCompression=true; . We've had a bunch of reports related to that recently. Seems to be something breaking with http/2 and mw gzip support.

For error 2. Generally you should run it from the commandline via ssh or putty.

If that's difficult you can also run via the web interface by going to mywiki.com/w/mw-config (assuming your wiki is installed in /w )

VSN-Herman (talkcontribs)

Thanks for your quick response. (I still have to figure out how to set it up to send me an email notification of it, but I will ;-))

For error 1, I tried the setting $wgDisableOutputCompression=true; , but unfortunately it doesn't do the trick. I read somewhere that mediawiki 1.35.1 would not run on PHP versions up to 7.4.2 and could it have something to do with that?

For error 2, I managed to run mw-config, while another error message followed. See the screenshot.

Error message on mw_config
Bawolff (talkcontribs)

I dont think its a php version issue, more an issue with apache.


For the new screenshot. That's weird sounds like a bug. Maybe report at https://phabricator.wikimedia.org

VSN-Herman (talkcontribs)

Hello Bawolff, thanks again for your thoughts.

On the site https://vsn-nederland.nl - (based on version 1.34.4) - everything does seem to work fine and so it remains a mystery to me.

I will certainly report the mw-config problem at https://phabricator.wikimedia.org, (thanks for the link), and am curious.

VSN-Herman (talkcontribs)

@Bawolff Hi, in the meantime I have updated to MW version 1.35.2, and Yes, the problem with display by chromium and webkit browsers appears to be solved 👍. Zie https://vsnwiki.nl

Reply to "Problem with chromium/webkit browsers and login"
VSN-Herman (talkcontribs)

Day All, when I check the site vsn-nederland.nl with for example Bing, I get: "The inspected URL is a redirect and cannot be indexed by Bing". Then when I check the redirection I get: "Meta description tag missing".

Does anyone know how I can solve this ?

I can't find an html file anywhere to modify the headers in ?


MediaWiki 1.34.4

PHP 7.4.16 (litespeed)

MariaDB 10.3.28-MariaDB-log-cll-lve

ICU 64.2


Hope 1 of you knows advice.

Kind regards

Jonathan3 (talkcontribs)
VSN-Herman (talkcontribs)

I tried that, but it gives the same result

Bawolff (talkcontribs)

i dont think search engines use meta descriptions anymore.

VSN-Herman (talkcontribs)

That's also an answer, but ... let's just assume that I'm really curious about this and assume that there will be a solution after all.

Or am I asking too much ?

Where can I adjust the headers ? (That's what I'm curious about ;-) At most sites in html, but where can I find that file ?)

Jonathan3 (talkcontribs)

I'd be interested to see what tests you're referring to - could you share links here?

I wonder if it's possible to avoid example.com changing to example.com/Main_Page (but still serve the Main Page) - maybe some ideas here: Manual:Short URL/Apache?

Extension:WikiSEO lets you add meta tags like description.

VSN-Herman (talkcontribs)

First, of course, you are completely free to test the site vsn-nederland.nl with whatever site tester you want. With Nibbler the site gets an overall score of 7.2 , which is not bad at all. Just think of me as someone who came out of Formula 1 and still wants better scores.

The suggestions you made are certainly interesting, well worth looking into. The Extension:WikiSEO I would like to install, while I understand that it is for version 1.35 and higher and can't find the version for 1.34. (Which of course could be just me !)

Ps.

As long as version 1.35 and up doesn't work with all browsers I'm not going to update.

Jonathan3 (talkcontribs)

With WikiSEO I'm using v1.2.1 with MW 1.34 and I see there's a 1.2.1 tag you could use if downloading using git.

Could you tell me about 1.35 and browsers? I am on the verge of upgrading from 1.34 to 1.35 as I think finally most of the extensions/skins I use are now compatible.

VSN-Herman (talkcontribs)

Okay, thanks, I'll definitely try.

About 1.35 and browsers I posted an issue under Problem with chromium/webkit browsers and login.

It may be that the display problem has been fixed with an update to MW version 1.35.2. I don't know ... I have not been able to try it out yet because the host has to change a setting first: "php-proc-get-status ON (detected: OFF)". (As long as on off an update is not accepted by Installatron).

I hope it will happen next week.

VSN-Herman (talkcontribs)

@Jonathan3 Hi, in the meantime I have updated to MW version 1.35.2, and Yes, the problem with display by chromium and webkit browsers appears to be solved 👍. Zie https://vsnwiki.nl

Reply to "Meta description missing"

Find out whether file has a thumbnail image

4
Jonathan3 (talkcontribs)

I have a template that displays the thumbnail of the relevant file, which usually is a PDF. I have a small number of PDFs which (for whatever reason) no thumbnail can be generated. Also some files are DOC files which similarly have no thumbnail.

The problem is that when there is no thumbnail, the text File:Filename.pdf is displayed: I'd rather have no text displayed if there is no thumbnail.

Is there a way (magic word, extension etc) to find out within the template whether the file has a thumbnail? Or some other way of ensuring no text is displayed in lieu of the missing thumbnail?

For the time being, I'm using #pos to work out whether the filename contains ".pdf", which cuts out the DOC files, but I'd like to be able to identify the PDFs with no thumbnail as well.

Thank you.

Bawolff (talkcontribs)

maybe scribunto you could look up the images width/height. Typically, images that cant be displsyed are treated as having 0x0 dimensions.

Jonathan3 (talkcontribs)

Thanks. Yes, they are all shown as "0x0". I've avoided learning Lua/Scribunto so far, but when I eventually do, I'll remember this and have a go. Jonathan3 (talk) 07:44, 18 April 2021 (UTC)

TheDJ (talkcontribs)
Reply to "Find out whether file has a thumbnail image"

Change the interface language for anonymous via JavaScript

2
Spas.Z.Spasov (talkcontribs)

Hello,

I'm tring to create a script that changes the MediaWiki interface language via javascript based on the page language at my private wiki.

For logged-in users I'm able to do that by changing the user's options via an API request as shown below, but this do not work for anonymous users. So my question is: Is it possible to change the interface language for anonymous users/visitors via JavaScript? And how do I do that?

/**
 * Automatic switch of wgUserLanguage, based on wgPageContentLanguage
 * The output of Template:AutoLangSwitch (id='auto-lang-switch') is a triger
**/
( function ( $, mw ) {
	mw.loader.using( 'mw.Api' ).then( function () {
		var nSspaceN = mw.config.get( 'wgNamespaceNumber' );
		var lgAction = mw.config.get( 'wgAction' );
		var pageLang = mw.config.get( 'wgPageContentLanguage' );
		var userLang = mw.config.get( 'wgUserLanguage' );
		var langTest = document.getElementById( 'auto-lang-switch' );
		
		if ( pageLang !== userLang && lgAction === 'view' && nSspaceN === 0 && langTest ) {
			var params = {
				action: 'options',
				change: 'language=' + pageLang,
				format: 'json'
			},
			api = new mw.Api();
			api.postWithToken( 'csrf', params ).done( function ( data ) {
				console.log( data );
			} );
			location.reload();
		}
	} );
}( jQuery, mediaWiki ) );
TheDJ (talkcontribs)
Reply to "Change the interface language for anonymous via JavaScript"
Onmiy (talkcontribs)

Hello,

I have installed the extension AccessControl to create user orientied pages.

Details:

- Media Wiki 1.35.1

- latest Version of AccessControl


Problem:

I have created namespaces and defined users in lists, but it does not work as it should. On the page, which should not be visible to all, i added

<accesscontrol>Quality:Mitarbeiter</accesscontrol>

The namespace ist Quality and the page name in this namespace is Mitarbeiter. There are also alle user names in bullet points *. But it does not work. Do I have forgot something? Thank you

Reply to "Extension AccessControl"

Creating thumbnails for multiple files

15
Jonathan3 (talkcontribs)

On my old server, MediaWiki couldn't create thumbnails for PDFs. I never got the bottom of why it didn't work. Anyway, now, on a new server, it can. When I purge a File: page, usually it's able to create a thumbnail. How could I go about creating thumbnails for all files (or all files which currently have no thumbnail)?

Would I be able to use Manual:purgeList.php - and is there anything I should watch out for?

Thank you.

Bawolff (talkcontribs)

I would suggest scripting requests to thumb.php


If you're not using a 404 handler, running refreshLinks.php might be a good option for thumbs in pages (but not the preview link on the image description page)


I think purgeList only does cdn purges, which is wrong type of purge for this

Jonathan3 (talkcontribs)

I've had a look at Manual:Thumb.php. I don't fully understand that part about 404 handlers.

I only have about 100 or so files that I think will need thumbnails created, so don't think complicated code would be worthwhile. Especially as I'll be identifying the files manually. If I were to just create a list of links like

https://example.com/w/thumb.php?f=Filename.pdf

and just click on each of them, would that do the job?

Bawolff (talkcontribs)

you would have to specify the width you want as the w parameter.

Jonathan3 (talkcontribs)

Most of my PDFs are A4 size and the File: page says something like:

Size of this JPG preview of this PDF file: 424 × 600 pixels. Other resolution: 170 × 240 pixels.
Original file ‎(1,240 × 1,754 pixels, file size: 60 KB, MIME type: application/pdf, 2 pages)

It seems that the File: page uses the 424-wide one for the current page, and the 170-wide one for the previous/next page.

And when used on a wiki page with [[File:...]], judging from the quality, it's the 424-wide one being used.

Should I run thumb.php for both widths? Or can it only create one thumbnail per file?

I could just try it out rather than asking, but don't want to mess anything up!

Thanks.

Jonathan3 (talkcontribs)

Thinking about it - it might be as easy just to visit each File: page and purge it :-)

Jonathan3 (talkcontribs)

When I go to example.com/thumb.php?f=Filename.pdf&w=424 I get the error:

Error generating thumbnail
Error creating thumbnail: No path supplied in thumbnail object

What should I do? Thanks.

Bawolff (talkcontribs)
Jonathan3 (talkcontribs)

I tried that on one file and then the thumb.php URL again, but got the same error message.

sudo php refreshImageMetadata.php --start="Filename.pdf" --end="Filename.pdf" --verbose --force
[sudo] password for ...:
Processing next 1 row(s) starting with Filename.pdf.
Forcibly refreshed File:Filename.pdf.

Finished refreshing file metadata for 1 files. 0 needed to be refreshed, 1 did not need to be but were refreshed anyways, and 0 refreshes were suspicious.

The File: page still shows the PDF as having 0x0 pixels. It wasn't one of those PDFs that thumbnails don't work for, as purging the wiki File: page created the thumbnail all right.

Jonathan3 (talkcontribs)
Bawolff (talkcontribs)

> i thought Manual:purgeList.php might work. It's supposed to be the same as &action=purge (see here). But again it didn't create a thumbnail.

Its not, it does only varnish purging not other types.

Jonathan3 (talkcontribs)

Sorry - I meant to type "I thought Manual:PurgePage.php might work."

I knew from your previous comment that purgeList.php wouldn't work (though I tried it out of curiosity...)

Bawolff (talkcontribs)

oh, that script is new. I hadn't heard of it before. Sounds like it would work.

I suspect the main problem is the metadata is claiming that the file is 0x0 dimensions which makes it impossible to thumbnail. Purging causes it to reread the meatadata and get the correct dimensions.

Jonathan3 (talkcontribs)

I realised from a comment of Bawolff's on a different topic that it's Extension:PdfHandler rather than MediaWiki that creates thumbnails for PDF files (which is what I'm dealing with here). Though I suppose that extension might hook into MediaWiki code so maybe generic MediaWiki scripts should now work for PDFs.

Anyway, I checked the talk page there and saw that someone had asked "How to create thumbnails of all existing PDF files?" 5 months ago (Topic:Vy98ku0kdjuq3nrw)... and that the person was me...... unfortunately there was no reply.

Jonathan3 (talkcontribs)

You mentioned Lua before but maybe the API would have a less steep learning curve.

I think it would be possible to write a script to find all PDFs with 0x0 dimensions (using something like this, based on an example here/here) and then to purge those File: pages (something like this, an example from API:Purge). I'd check first whether the API purge includes (re-)creating thumbnails in the the way that ?action=purge does (as the maintenance scripts don't seem to).

Does this sound like it would work?

Reply to "Creating thumbnails for multiple files"
109.187.176.241 (talkcontribs)

Через МФЦ поступило личное дело, введено и к нему ошибочно прикреплено личное дело другого безработного. Каким образом "разъединить " эти два дела?

Malyacko (talkcontribs)

Hi, what does this have to do with MediaWiki? See the sidebar. Thanks.

Reply to "Личное дело"

Class 'SkinChameleon' not found

2
Widetest (talkcontribs)

I have a problem updating the mediawiki version. Indeed I installed mediawiki 1.31.14 with BlueuSpice 3.2.1. I integrated Semantic Mediawiki version 3.1.6, everything goes very well, but once I have updated the system with "maintenance / update", the application does not start anymore and displays the message:

Fatal error: Uncaught Error: Class 'SkinChameleon' not found in /home/xxxxxx/example.com/skins/BlueSpiceCalumma/src/Skin.php:11.

If there is anyone who can help me i will be very happy

Osnard (talkcontribs)
Reply to "Class 'SkinChameleon' not found"

Is there any difference for icons?

2
Аргскригициониец (talkcontribs)

This wiki uses complex template for icons like: {{icon|opinion}} {{icon|state religion happiness}} etc. Page of icon template

On my wiki I use a simplified way: I just create a new template for each new icon like {{opinion}} ((state-religion}} etc.

Is there any difference in these methods if I speak about perfomance? There can be more than 100+ icons on a page, so I wonder if my method is overloading or there is no any difference apart from convenience.

Bawolff (talkcontribs)

Its unlikely that there is a performance difference, or if there is, its probably to small to notice.

Note: If you are using instantcommons, there is known performance issues with that feature when you have a large number of images on a page.

Reply to "Is there any difference for icons?"