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

Remove file category information

2
Snow white and dwarves (talkcontribs)

In my personal wiki, an image file is listed as „Media contained in category X“ on a category cover page. I'd like to remove the media file from this category, but I can't, as the image page itself contains no category information.

What makes things even worse is that the image file is not only listed on the category page but its name is overwritten by the string „file is missing“.

Can I get rid of this through maintenance scripts or fiddling with SQL? Thanks for your help!

Bawolff (talkcontribs)

Sometimes this can happen if the title contains invalid UTF-8 (And there are two files with basically the same name but one in an invalid variant of UTF-8).

try running cleanupTitles.php.

The alternative is to try and find the page id of the image via the api, and manipulate it that way. However the maintenance script is much easier.

Reply to "Remove file category information"

Force thumbnail generation with PdfHandler?

2
Kjecl (talkcontribs)

I recently performed an reinstall and database restore of a Wiki to fix a different problem. An unexpected positive side effect was that thumbnails are now generated for new PDF files uploaded to the Wiki. Cool!

Is there a way to force the generation of thumbnails for previously uploaded PDFs? I have tried:

php refreshImageMetadata.php -f

followed by:

php rebuildImages.php

without effect.

Thanks for any suggestions.

Bawolff (talkcontribs)

What do the old images look like? Is there an error message instead of a thumbnail or is it just missing. Does mediawiki show the correct dimensions for the files in question (as in, does it say it is 0x0 pixels or does it give a real number)?

Reply to "Force thumbnail generation with PdfHandler?"

I can't do php update.php or php run.php update

4
Christbirego (talkcontribs)

Hello I am a beginner contributor on mediawiki and I have errors on the installation of extensions my mediawiki I installed with compose. now I can not do: php update.php

Bawolff (talkcontribs)

Please include what errors you have. Please explain what you mean by not being able to do update.php (i.e. what is stopping you).

Christbirego (talkcontribs)
error update.php

When I update, the process does not run to completion

Bawolff (talkcontribs)

Are you running this script on the same host as your mediawiki is on?

Reply to "I can't do php update.php or php run.php update"

Mobile version doesn't update

2
ConstanceSL (talkcontribs)

Hi all,

I made a wiki with Miraheze for an event I'm organising. I was doing the last updates last night, when I saw that the mobile version wouldn't update anymore. I've tried to clear the cache, it doesn't help. So this morning I went to check the logs and hid all the small changes to the settings I had done. It just made things worst, as now the titles don't expend anymore and the whole wiki is basically useless on mobile. The weird thing is that from some pages, it displays the changes I made to the side bar since, and if I click on links to pages I had not made yesterday, it sometimes bring me to the page I made this morning, and sometimes it doesn't.

I've tried to just disable the mobile front end, as it works well on my phone when I request the desktop version. But it didn't work, it still shows me the broken mobile version by default.

I'm new to media wiki, and I have no idea how most of this works. But I'm pretty desperate. I've spent weeks preparing the wiki and was suppose to release it today to the participants. Any idea how to fix this?


Thanks!

Bawolff (talkcontribs)

Possibly this is a bug on the miraheze side where mobile is not recieving CDN purges. Please ask at miraheze support.

Reply to "Mobile version doesn't update"

help : cannot use a Tunit inside a syntaxhighlight

1
Wladek92 (talkcontribs)
Reply to "help : cannot use a Tunit inside a syntaxhighlight"

The Translation tool has too many problems

1
Filipe46 (talkcontribs)

I already complained about that, made the ticket and everything. Yet, no solutions were presented.

The tool keeps flagging every single stretch of the text as having 100% to 96% unmodified text, thus blocking the publication of the article. Almost every translation keeps giving me the false-positive of it being an earlier version of the article, thus also impeding the publication of the same.

The tool never saves the infobox, thus forcing me to remake it every time I open the translation. It keeps losing entire paragraphs already translated, thus wasting my time in re-translating the same thing 3 or 4 times.

It also clashes auto translation with my translations, usually on links.

Reply to "The Translation tool has too many problems"

Extension Popups

1
Sokradia (talkcontribs)

Hello

I have a small issues with this extension.

Mediawiki 1.39.7 (Sokradia (cc-zeitlos.synology.me))

Since some upgrades the popup funktion looks that it is not working, when the extension passes over a namespaces like categorie.

I have an additional Namespace named Quelle (in englisch "Source" an 3000 and 3001)

Typicly popups has to go sometimes over this namespace to have his preview funktion this is also not working...

An other mystery view is ... if Popup has to look in the namespace to an other page which not not have simple text, because he start directly with an TOC (Überschrift / Header) then also the preview text will not be displayed.

Thank you for your help

Reply to "Extension Popups"

JS Library for MediaWiki

5
מיכי י-ם (talkcontribs)

I want to create a js library for using indexedDB Where do I upload the code and how? In addition, where are development guidelines?

Bawolff (talkcontribs)

Can you give more context? Who is this library for, what code would be using it?

מיכי י-ם (talkcontribs)

I didn't understand the question. I want to create a basic library for a variety of uses, it will be used on wikis to create local databases, store information in them and retrieve it.

Bawolff (talkcontribs)

MediaWiki is not a general place to store libraries. We generally expect code contributed to MediaWiki is going to be used by MediaWiki.

מיכי י-ם (talkcontribs)

Absolutely agree, I think it will be used by MediaWiki users like mw.storage. Example of use. The current version of MediaWiki has the EditRecovery functionality that saves the edits in indexedDB, I am an editor on an external site that uses the LST version of MediaWiki and does not yet have this functionality and would like to integrate it using a script.

Reply to "JS Library for MediaWiki"

$wgUsePathInfo A problem by any definition

5
77.127.126.137 (talkcontribs)

MediaWiki ver 1.41

I had this problem shown here:

Topic:Xmvyl460z5y8k72q

So as written there I set $wgUsePathInfo = false; and that solved it

But then we get this problem:

Topic:X7zabcz2fkhb68rs

And here they write that the solution to this is: $wgUsePathInfo=true;

What to do? Is there a way to solve this?

Osnard (talkcontribs)
77.127.126.137 (talkcontribs)

I don't have this word in the LocalSettings folder

I didn't have wgUsePathInfo either until this problem

Osnard (talkcontribs)
87.70.1.55 (talkcontribs)
Reply to "$wgUsePathInfo A problem by any definition"

Block Video Uploads for Non Admins - Extension Troubleshooting

2
Kimmywingz (talkcontribs)

Hello,

I am working on a custom extension that would only allow admin users to upload video files, the extension is enabled and appears under Special:Version. The permission also appears under the correct category under Special:ListGroupRights.

However, when I attempt to upload a video (mp4) under Special:Upload, it goes through.

I just enabled error reporting / showExceptionDetails / debugToolbar / ShowDebug / DevelopmentWarnings and added print statements to my extension file, but I am not seeing any indicators that it's trying to work but is failing.

I am hoping somebody could point me in the right direction on how to debug this more efficiently or offer insight into the problem. Thank you for your time and expertise.


In the PHP file:

namespace MediaWiki\Extension\VideoPermissions;

use MediaWiki\Hook\UploadVerifyUploadHook;

use User;

use UploadBase;

class PermissionCheck implements UploadVerifyUploadHook {

public function onUploadVerifyUpload (UploadBase $upload, User $user, ?array $props, $comment, $pageText, &$error) {

$file = $upload->getLocalFile();

if ($file->getMediaType() !== MEDIATYPE_VIDEO) {

return;

} else {

$title = $upload->getTitle();

if ($user->definitelyCan('videopermission-allow', $title)) {

} else {

$error = 'videopermission-no-perm-to-upload';

return false;

}}}


in the extension.json file:

"AvailableRights": ["videopermissions-allow"],

"GroupPermissions": {"sysop": {

"videopermissions-allow": true

}},

"Hooks": {"UploadVerifyUpload": "main"

},

"HookHandlers": {"main": {

"class": "\\MediaWiki\\Extension\\VideoPermissions\\PermissionCheck"

}},

Bawolff (talkcontribs)

So, first of all, print() (and echo) won't work in mediawiki due to output buffering. Always use var_dump() if you want to output something for debugging purposes to the page (or if you want to output to the debug log, use the debug logging system. You can use wfDebug() as a one off, or add a LoggerFactory as a dependency if you want to do it more properly for longer lived code). I personally tend to use var_dump() for one off debugging instead of debug log system, as i find it easier, but its a matter of personal preference.

One thing to note is that in workflows where a POST request is made, processing happens, and then the user is redirected to a different page, the debug messages will be associated with the redirect not the target. I believe that upload processing is one such example of this. In these cases wgDebugToolbar and var_dump wont work (a hack sometimes used is to follow var_dump() immediately by die() to stop processing). In such a case i reccomend setting $wgDebugLogFile to some file and then using wfDebug() for debugging. That way you wont miss the debug messages on redirects.


Based on your description it sounds like permissions are being setup correctly, but the hook is not firing. My suggestion would be to verify if that is true, by putting wfDebug("HERE"); as the first line of your onUploadVerifyUpload function and checking the debug log file to see if it is called at all. If it is being called then i would suggest recording the values of various conditions variables to ensure they match what you think they should be.

Another thing to check - i'm not sure at what point this hook is called. Determining media type is part of file verification. Possibly this hook happens before the file object knows the file is a video. If so, you might have better luck using the $props array passed to the hook. I believe it should also have media type information.

Reply to "Block Video Uploads for Non Admins - Extension Troubleshooting"