Open main menu

Project:Support desk

About this board

Welcome to MediaWiki.org's Support desk, where you can ask MediaWiki questions!

There are also other places where to ask :

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".
Previous page history was archived for backup purposes at Project:Support_desk/old on 2015-07-30.
Other languages: English  العربية čeština Esperanto français 日本語 中文

Detecting whether a remote page exists while formatting a wiki page

1
Vicarage (talkcontribs)

I am trying to tie a 20000 page wiki with a separate file repository with 5000 directories. Its rather random whether a wiki page has a matching repository page. Ideally I want to present a wiki link only if the target page exists, so users don't click on the link and get a 404. I would hope to write a template


{{repo}}

and for the template to check the validity of the remote link, and either display "Files here" if they were available, or blank if not. I'd rather not go down the pywikibot route of modifying pages as the files site changes.


I like the iframe extension, and if I could wrap that in a check, I could display the files page inside the wiki page neatly.

Reply to "Detecting whether a remote page exists while formatting a wiki page"

Upload: Thumbnails of archived versions are missing

1
Wikinaut (talkcontribs)
Reply to "Upload: Thumbnails of archived versions are missing"

Can I use QuestyCaptcha and ReCaptcha together?

10
Utini (talkcontribs)

Hello everyone,

I just finished setting up ReCaptcha and noticed that it creates a Captcha on "Edit" and "Create" of pages as well as "New user registration".

I thought it would be a perfect addition to use QuestyCaptcha for "registration" instead of ReCaptcha

Can I activate both options in my LocalSettings.php or will this give me any problems?


E.g.:


wfLoadExtensions([ 'ConfirmEdit', 'ConfirmEdit/ReCaptchaNoCaptcha' ]);

wfLoadExtensions([ 'ConfirmEdit', 'ConfirmEdit/QuestyCaptcha' ]);

$wgCaptchaClass = 'ReCaptchaNoCaptcha';

$wgReCaptchaSiteKey = 'your public/site key here';

$wgReCaptchaSecretKey = 'your private key here';

$wgCaptchaQuestions = [

'What is the capital of France?' => 'Paris',

'What is the capital of Spain' => 'MADRID', // Answers are case insensitive

'What is the name of this wiki?' => $wgSitename, // You can use variables

'How many fingers does a hand have?' => [ 5, 'five' ], // A question may have many answers

];

$wgMainCacheType = CACHE_ANYTHING;

$wgCaptchaTriggers['createaccount'] = true;

$wgCaptchaTriggers['badlogin'] = true;

$wgCaptchaTriggers['login'] = true;


Ciencia Al Poder (talkcontribs)

No, you should't activate both. It makes no sense at all. Would you require your visitors to solve both captchas?

What causes captchas to display is not the type of captcha, but this configuration that is captcha-independent:

$wgCaptchaTriggers['createaccount']          = true;
$wgCaptchaTriggers['badlogin']        = true;
$wgCaptchaTriggers['login']    = true;
Utini (talkcontribs)

I dont want to captchas at the same time. I want the easier "ReCaptcha" on edits and new pages creation and the "QuestyCaptcha" on registration and login.

Bawolff (talkcontribs)

confirmEdit isnt really designed for this, $wgCaptchaClass can only have one value. There are probably really hacky things you could do, trying to change the captcha clsss based on url, but i wouldnt reccomend it

2003:E5:4F42:1517:1C2F:7BD4:92CD:DD53 (talkcontribs)

Ye well I just decided to move to QuestyCaptcha for the whole website. But I am kinda afraid that one might simply give it 10 minutes to crack all my questions.

Anyway, is there any way to also add the captcha to the login page?


The following doesn't work:

$wgCaptchaTriggers['login'] = true;

Ciencia Al Poder (talkcontribs)

I'm pretty sure $wgCaptchaTriggers['login'] = true; works. Just be sure you don't access the login page while you're logged in

Utini (talkcontribs)

Nope I just tried it from different browsers and even different devices. Also the wiki on mediawiki doesn't list "login" as an existing option?

Ciencia Al Poder (talkcontribs)

You're right, I misread login with createaccount. There's no captcha for login.

Utini (talkcontribs)

Hmm a captcha on the login page would be awesome. Is there a place to request such things/features?

Ciencia Al Poder (talkcontribs)

phabricator. Honestly, I don't remember any website that has a captcha for login

Reply to "Can I use QuestyCaptcha and ReCaptcha together?"

Slack notifications not working wiki version 1.33

5
141.161.133.32 (talkcontribs)

i'm a newbie to mediawiki i have installed it on GCP through bitnami, can someone tell me how to integrate slack to mediawiki to get notification, i've followed this Extension:SlackNotifications documentation to install extension, i can see the extension is installed but i was unable to get notification on slack channel. this is my configuration

require_once("$IP/extensions/SlackNotifications/SlackNotifications.php");

$wgSlackIncomingWebhookUrl = "Slack_hook_URL";

$wgSlackFromName = $wgSitename;

$wgWikiUrl = "WIKI_URL";

$wgWikiUrlEnding = "index.php?title=";

$wgSlackSendMethod = "curl";

$wgSlackRoomName = "#alerts";

$wgSlackIncludeNotificationsFrom = ["Spark"];

$wgSlackNotificationAddedArticle = true;

$wgSlackNotificationEditedArticle = true;

$wgSlackNotificationRemovedArticle = true;

MarkAHershberger (talkcontribs)
141.161.133.216 (talkcontribs)

thanks

141.161.133.216 (talkcontribs)
Kulttuuri (talkcontribs)

Hi!


You have set this parameter to be correct, right?

$wgSlackIncomingWebhookUrl = "Slack_hook_URL";

Reply to "Slack notifications not working wiki version 1.33"

How to totally cancel edit summaries from beckend?

1
49.230.74.143 (talkcontribs)

I got conclusion that edit summaries cause more harm than good in many communities, due to the phenomena I recognize in many Wikipedias of inciting or trolling comments instead constructive summaries (especially in the form of question) and therefore would like to cancel them from backend in my personal MediaWiki site (CSS or JavaScript are not an option for me in this case).

Is there a ready-to-use way to totally cancel these (or to at least limit some characters inside them or add warning not to ask questions if a questions as summary but to prefer talk page) directly from LocalSettings.php?

Thanks anyway for your time,

Reply to "How to totally cancel edit summaries from beckend?"

Upgraded from 1.23 to 1.25 : new user issues

5
Justever (talkcontribs)

Hi there, I upgraded recently from 1.23 to 1.25, I also updated php from around 5.3 to 5.4. I was able to configure everything with some copying of files/folders and a lot of trial/error. I now have an issue when we try to create a new user. We use LDAP for authentication, and normally, you would just type in your user name (from AD) and your password, then MediaWiki would do the rest (add you to the database, configure your user group, etc). Now, it gives a fatal error from the includes/Users.php.


If i try to just copy over the entire includes folder, we can no longer access the wiki at all. So, I guess the question I'm asking is, what files/folders from includes is responsible for creating new users so I can copy them over to the new version?

Thanks!


Edit: here is the actual error

Fatal error: Call to a member function toString() on a non-object in /mediawiki/includes/User.php on line 3623

MarkAHershberger (talkcontribs)

Is there a reason you can't upgrade to 1.33?

Justever (talkcontribs)

Full disclosure, I am new to doing system administration, but the reason I don't want to upgrade that far is because a lot of the scripts/tools using PHP have been built on 5.3.3 or earlier. This isn't a company that upgrades often, and we are also using RHEL 6. I guess it's more of me not wanting to break everything by upgrading all this software (php 5 to 7 is a big jump). I figured if I took it slowly, I could be more careful about it. Upgrading to 1.25 was so I could use pdf/math functions which I couldn't get to work on 1.23.

Looking at the DB debug file I made, it almost seems like it won't actually write new users to the DB. Every time a new user tries to log in for the first time, it will increment the user_id, but it never actually creates it. So, before upgrading, the last user ID was 71, then after upgrading, the next user ID (when reverting back down to MW-1.23) is 77, (6 tries to make a new user before downgrading) and in the debug log i can see it at 82 or so now.

Thanks for your time!

Bawolff (talkcontribs)

The id keep being incremented probably means an insert happened, but it was rolled back when the error happened.

Line 3623 is 'user_password' => $this->mPassword->toString(),

So this error probably means that for some reason $this->mPassword was null. This should be pretty impossible to happen, since if the mPassword is null, then the code will look in the database to try and find the current password. The only way i can see this happening, is if nothing is in the database but a user id for the user has been assigned. Maybe this could happen if the user was inserted in a different transaction from the one checking the password, and the transaction is not yet committed (It does use DB_SLAVE to find the password by default).

I would generally assume its probably the fault of the LDAP extension you are using, somehow.

Justever (talkcontribs)

@MarkAHershberger @Bawolff Thanks for your help, it turned out to be the 1.23 version of LDAP wasn't compatible. I grabbed the 1.25 version from the github and we are good. My last question, just for clean up, can i fix the user_id's being out of wack since it skipped a whole bunch or am i stuck with it?


Thanks again.

Reply to "Upgraded from 1.23 to 1.25 : new user issues"
Allbiomed (talkcontribs)

I am having a problem with my Module:TNT where I am getting an error


https://www.allbiomed.org/Module:TNT


Lua error at line 157: attempt to index field 'data' (a nil value).


This is in turn causing problems importing templates. I thought it had something to do with the JsonConfig, which I have installed, but it didn't change anything.


I am running

Product Version
MediaWiki 1.33.1
PHP 7.2.21 (cgi-fcgi)
MySQL 5.7.23-percona-sure1-log
ICU 57.1
Lua 5.1.5

I appreciate the help.

Reply to "Module:TNT error"

Image upload : no thumbnail generated, error code =-1

3
Amagnien2 (talkcontribs)

I am using the latest version of Mediawiki (1.33.1). Standard installation, PHP 7.3, no fancy extensions. Computer is a PC, Windows 10, latest version.

On my first attempt to upload a small jpg (less than 1 MB), I got the error message - translated from French - saying "Error when creating thumbnail: Error code = -1".

Image itself is usable, apart from options: setting limits to width and height does not seem to work at all.

I have looked at recent posts regarding such issue and could draw no conclusions about how to correct those glitches:

- no thumbnail

- size limits not working (I'll open a topic later on about this one)

thanks for any hint

Bawolff (talkcontribs)

What are your image related configs in LocalSettings.php ?

I think the most likely cause is that either image magick (convert.exe) is not installed, or MediaWiki cannot locate it. MediaWiki normally uses that program to create thumbnails (although if the installer cannot find it, and the gd php extension is installed, sometimes the installer will configure to use that instead

Amagnien2 (talkcontribs)

You got it - ImageMagick was not installed. Now it is (last available version, static), and I have successfully tested it, using the command line.

I also updated localsettings.php with the following lines:

________________________

## To enable image uploads, make sure the 'images' directory

## is writable, then set this to true:

$wgEnableUploads = true;

$wgUseImageMagick = true;

$wgImageMagickConvertCommand = "C:\Program Files\ImageMagick-7.0.9-Q16\magick.exe";

________________________

Indeed, there is no convert.exe file any more; "magick" is now the proper command.

Still, I got in trouble, as any attempt to create a thumbnail on file import will result in the following report :

Erreur lors de la création de la miniature : /bin/bash: C:\Program Files\ImageMagick-7.0.9-Q16\magick.exe: command not found Error code: -1

(and the magick.exe file is definitely there; by the way, removing ".exe" from the path does not remove the error, which is hardly surprizing)


Maybe I should try an older version still using convert.exe ? (although I doubt it would solve anything)

Reply to "Image upload : no thumbnail generated, error code =-1"
Squeak24 (talkcontribs)

Hi, I have recently discovered an issue on all my Wikis where I have two links next to each other pointing to the Help pages. I have only seen this so far happening on the category pages.

Is there anyway to get rid of one of these links?

Squeak24 (talk) 11:48, 18 November 2019 (UTC)

AhmadF.Cheema (talkcontribs)

Where exactly are these "two links" located on the category pages?

Also, what's your MediaWiki version?

Squeak24 (talkcontribs)

In the top right hand side of the page. If you go to the All skins page you will see it once.

Instead of it spearing once, I am seeing it twice. When I inspect the code, I am seeing the HTML twice. I have tried to look at the Vector template files but I can't find where it is called from.

The MediaWiki version is 1.31.

Any help is appreciated

Squeak24 (talk) 10:43, 19 November 2019 (UTC)

AhmadF.Cheema (talkcontribs)

First, try disabling all your extensions to make sure it isn't some old incompatible extension.

Bawolff (talkcontribs)

Can you link to your wiki?

Squeak24 (talkcontribs)

AhmadF, I will try disabling the apps later today. Thank you for the input.

Bawolff, unfortunately it is on a local network hence not accessible to users outside the organisation.

Squeak24 (talkcontribs)

A quick update, I have just turned all the extensions off on my development Wiki and I still get the two helps links.

Reply to "Helplink duplication"

Show recent page changes on a page

11
This post was hidden by 196.190.186.110 (history)
Gustave London (talkcontribs)

You add this page in the your watchlist.

Seehausen (talkcontribs)

No, i want in general to show a recent changes feed just of the current page in the upper part on the current page and not user-dependent.


Let´s say i want to include {{ Special:RecentChanges }} , but just showing the recent changes section of the page where i included it and not showing recent changes of the whole wiki.

Is that possible somehow?

Ciencia Al Poder (talkcontribs)

You want to show the page history, not recent changes.

There's no magic word to do that. I don't know if there's an extension to do that. With JavaScript, you can query the API:Revisions to get the info you want and insert it anywhere on the page. Of course, that needs coding skills.

Jonathan3 (talkcontribs)
Seehausen (talkcontribs)

Ok that´s good to know. I tried to test a query with the API-sandbox and the JSON output would be:


{

   "action": "query",

   "format": "json",

   "prop": "revisions",

   "titles": "Main Page",

   "rvprop": "timestamp|user|comment",

   "rvlimit": "5"

}


Where do i need to "code" that query/snippet and what would i need to write in the page content text box to refer to the code then and show the page history finally?

Please go slightly in detail.


Best regards and thank you!

Seehausen (talkcontribs)

@Jonathan3I installed the Extension:DynamicPageList (third-party) because according to the manual for my use case it offers some solutions.

But as i installed the extension i didn´t have editing permission on the pages anymore.. So i couldn´t put the any tags /content on the pages.

Does the extension automatically restrict access on the pages and i need to change user rights first?

AhmadF.Cheema (talkcontribs)

Regarding the extension, it probably isn't supposed to, so it might be a bug. First, make sure you have that extension version installed which corresponds to your MediaWiki version; second, make sure Extension:DynamicPageList (third-party) is the problematic extension, it's possible that some other extension is bugging out (a previous version of Extension:Lockdown is known to cause this).

Jonathan3 (talkcontribs)

I have never had that problem so unfortunately can't help you.

I just use the latest extension versions from git whenever I upgrade MediaWiki – but I never keep up to date with MediaWiki – so maybe you're having a problem because you have the current MediaWiki version.

Seehausen (talkcontribs)

@Jonathan3


I now used the latest extension version of DynamicPageList3 , updated the Wiki and inserted the following code according to the manual:


{{#dpl: title= MainPage

|addeditdate=true |ordermethod=lastedit |order=ascending

|count=10 }}


but it returns the following error:

"Error: no suitable entry found.", although the MainPage was edited recently.

(If i include the line "namespace= |MainPage" instead of "title= MainPage" it shows recently edited subpages, but we just want to display a smaller "history" of the current page (excluding changes of subpages))


Does anyone have an idea what the problem could be?


Best regards and thanks in advance.

134.130.74.86 (talkcontribs)

Hi everyone,

I have a similar problem, can anyone help please?



Reply to "Show recent page changes on a page"