Project:Support desk

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".
85.255.237.14 (talkcontribs)

Hi,

I'm using CirrusSearch. I just wanted to confirm, on a public wiki do you agree there should be no confidential information stored in elasticsearch?

And to confirm I am assuming elasticsearch is only used for Cirrussearch.


i.e. no logs are stored with, say, emails, passwords, or anything that could be a security risk?

Thank you

Reply to "CirrusSearch"

Upgrade steps from really old version

13
JohnAintree (talkcontribs)

I've been trying to upgrade this for a week - we moved our old wiki from 2008 to 2016 server now I need upgrade php for security reasons after an audit -


I have looked at the compatibility list in great detail and found every time I wen t to 1.35 from 1.23 it failed - I managed as below to go to a middle step -


Perhaps I am jumping to far ahead - we are on 1.23 and PHP 5.4.23 and MySQL 56 - I want to go to MW 1.35 PHP 7.4 and mysqL56 - can I do this in one go. I have tried about 10 times now I can get to MW1.30 PHP 7.1.329 - I'm missing something - do I need upgrade in steps or go straight.

We are on Windows 2016 and IIS - I am no php expert - its driving me mad - - been at this a week -

Malyacko (talkcontribs)

If there is an error then please tell us the error message.

JohnAintree (talkcontribs)

There is no error on HTTP -500 and a blank page - the roro I think is in PHP as I get to the you must upgrade PHP page then I do the I get nothing -

204.113.253.88 (talkcontribs)

Go Here and you'll see that Php 7.4 to 7.4.2 is not supported

Maybe that will help

This post was hidden by Bawolff (history)
204.113.253.88 (talkcontribs)

Sorry, I don't mean to spam, I accidently posted it twice

Bawolff (talkcontribs)

enable php error reporting or check your php error log.

See How to debug

JohnAintree (talkcontribs)
JohnAintree (talkcontribs)

OK I am copying 1.35 over the top of 1.23 -

MediaWiki 1.35 internal error

MediaWiki 1.35 requires at least PHP version 7.3.19; you are using PHP 5.4.30.

Supported PHP versions

Please consider upgrading your copy of PHP. PHP versions less than v7.2.0 are no longer supported by the PHP Group and will not receive security or bugfix updates.

If for some reason you are unable to upgrade your PHP version, you will need to download an older version of MediaWiki from our website. See our compatibility page for details of which versions are compatible with prior versions of PHP.


Ok now I change to

7.3.19

The website cannot display the page

HTTP 500

Most likely causes:

  • The website is under maintenance.
  • The website has a programming error.

What you can try:

JohnAintree (talkcontribs)

Fatal error: Uncaught Error: Class 'AuthPlugin' not found in C:\inetpub\wwwroot\itkb\extensions\LdapAuthentication\LdapAuthentication.php:131 Stack trace: #0 C:\inetpub\wwwroot\itkb\LocalSettings.php(140): require_once() #1 C:\inetpub\wwwroot\itkb\includes\Setup.php(143): require_once('C:\\inetpub\\wwwr...') #2 C:\inetpub\wwwroot\itkb\includes\WebStart.php(89): require_once('C:\\inetpub\\wwwr...') #3 C:\inetpub\wwwroot\itkb\index.php(44): require('C:\\inetpub\\wwwr...') #4 {main} thrown in C:\inetpub\wwwroot\itkb\extensions\LdapAuthentication\LdapAuthentication.php on line 131

JohnAintree (talkcontribs)

I backed up localsettings.php now can progress


but fails here

An error occurred:

Error 1091: Can't DROP 'img_user_timestamp'; check that column/key exists (localhost)

Function: Wikimedia\Rdbms\Database::sourceFile( C:\inetpub\wwwroot\itkb/maintenance/archives/patch-drop-image-user-fields.sql )

Query: ALTER TABLE `image`

DROP INDEX img_user_timestamp,

DROP INDEX img_usertext_timestamp,

DROP COLUMN img_user,

DROP COLUMN img_user_text,

ALTER COLUMN img_actor DROP DEFAULT

JohnAintree (talkcontribs)

This is indeed painful - and difficult to install -

Reply to "Upgrade steps from really old version"

Is there an equivalent to Special:AllPages with no redirects?

4
Summary by YousufSSyed

Actually, with this CSS, I can hide redirect links in Special:AllPages

.mw-special-Allpages .allpagesredirect {

  display: none;

}

YousufSSyed (talkcontribs)

or is there a way to hide them on the page? I want to see all non-redirect pages in the main namespace.

Ammarpad (talkcontribs)

There's an option to hide redirects, but it's disabled if the wiki is using $wgMiserMode. If you're on your on wiki, you should be able to see it. On Wikimedia wikis it's not possible since miser mode is enabled.

YousufSSyed (talkcontribs)

Where's the option to hide redirects? Also is there a way to get it working even with Miser Mode on, I keep it on improve performance.

Ammarpad (talkcontribs)

If you disable the miser mode you'll see it. No, you can't have both.

How to put "Subject" under additional fields (instead of above them)?

1
182.232.129.245 (talkcontribs)

MediaWiki 1.34.2 with Extension:ContactPage

My principally all default contact form as an automatically-formed "Subject" field; this field defaultly appears above additional fields (of the AdditionalFields array) but I want it to defaultly appear under them.

How to put "Subject" under additional fields (instead of above them)?

I need a backend solution (if I change it frontendly with JavaScript than the order of the fields in the form's input will mismatch the order of the fields in the form's output).

Reply to "How to put "Subject" under additional fields (instead of above them)?"

How to add an email field to a ContactPage contact form?

7
49.230.16.152 (talkcontribs)

I have a principally all core 1.34.2 MediaWiki website with one extension (Extension:ContactPage)

I went through ContactPage documentation here and through HTMLForm documentation here and didn't find any mention for an email field.

Just a side note - email fields are well accepted in Drupal and WordPress so I am a bit surprised not to find them in MediaWiki; perhaps I miss something.

How to add an email field to a ContactPage contact form?

Ammarpad (talkcontribs)

There's already an email field by default. 'RequireDetails' => true, will make it mandatory.

182.232.129.245 (talkcontribs)

@Ammarpad

I vaguely recalled I had an email field and didn't understand where it disappeared to, now I understand:

If 'AdditionalFields' => array() is not empty, than it stops appearing.

Because, indeed, my additional fields array isn't empty and shouldn't be empty my question still stands.

Ammarpad (talkcontribs)

I don't understand what you mean. Whether 'AdditionalFields' is empty or not, there's an email field. In fact you cannot remove it without fiddling with the extension code, maybe that's what you did. MediaWiki:contactpage-fromaddress is the label message for the email field.

182.232.129.245 (talkcontribs)

@Ammarpad

Actually it did happen to me - when my array wasn't empty the email field in the form was gone (!) but now I understand that it happened because some buggy code inside the array; when I debugged the code the problem was gone and the email field was back on the form !

The bug/problem was, if I recall correctly the lack of 'class' => 'HTMLTextField', and perhaps also the lack of a comma, in two similar fields.

182.232.129.245 (talkcontribs)

@Ammarpad it might have actually been a CSS problem --- as I am adding fields I am starting to have "jumbeled" CSS, for example, only the notification "your email is needed to get a response" (translated from Hebrew) appears but not the email field (although the email field appears in HTML source) and also, the checkbox box for "send me a copy of my message (translated from Hebrew) goes on top of that very message.

I think that the CSS of the form isn't modular.

182.232.129.245 (talkcontribs)

@Ammarpad please delete my last message above about CSS, because it is misleading:

The CSS of the form is indeed modular; it's I that caused harm with a CSS change I made long ago and I now fixed (I mistakenly made the email field to have display:none by either canceling its display solely or the display of a class it shares).

Reply to "How to add an email field to a ContactPage contact form?"

What is the difference between label and contact-label in ContactForm?

6
49.230.16.152 (talkcontribs)

MediaWiki 1.34.2 with Extension:ContactPage

I have read the following sentence in HTMLForm documentation here which maybe I don't understand:

Label for a form input/button. Overridden by hlabel-message.

What is the difference between label and contact-label in ContactForm?

Isn't declaring a label makes contact-label redundant?

Ammarpad (talkcontribs)

Where did you see "contact-label"? It's neither in the master branch of ContactPage nor in HTMLForm.

182.232.169.61 (talkcontribs)

I am sorry,

I confused

Where contact-label I should have been:

'label-message' => 'emailmessage',

182.232.169.61 (talkcontribs)
Ammarpad (talkcontribs)

The difference is already in their names. 'label-message' takes a MediaWiki message key or object. So when you have 'label-message' => 'emailmessage', the label will be fetched via standard message mechanism at MediaWiki:emailmessage. If you use 'label' => 'emailmessage', emailmessage will be output as is.

182.232.129.245 (talkcontribs)

The difference wasn't clear for me from their names :)

But after reading your explanation I understand that 'label-message' => 'emailmessage', is a command to automatically create some default label by the nature of MediaWiki per field type (and if data to do so is available) and 'label' => 'emailmessage' can utilize this possible behavior or instruct a custom label.

Reply to "What is the difference between label and contact-label in ContactForm?"

Missing pages, but data appear to be intact

7
Jonahgreenthal (talkcontribs)

My wiki is missing a bunch of pages. I think it's specifically the pages that only had one revision. Possibly only if that revision was very old.

Here's an example page: https://www.qbwiki.com/wiki/St._Anne%27s . It says there's no text in this page, but the page, revision, and text tables all seem to have the right data.

Other observations:

The revision #0 of the page named "St. Anne's" does not exist.
This is usually caused by following an outdated history link to a page that has been deleted. Details can be found in the deletion log.

(but the deletion log doesn't show anything)

  • When I try to save an edit, I am told there is an edit conflict ("Someone else has changed this page since you started editing it.")
  • I can delete the page and then re-create it
  • I fiddled around with the PHP code to see where the error text was coming from. It's Article.php line 436, in the fetchRevisionRecord() method:
// $this->mRevision might already be fetched by getOldIDFromRequest()
if ( !$this->mRevision ) {
	if ( !$oldid ) {
		$this->mRevision = $this->mPage->getRevision();

		if ( !$this->mRevision ) {
			wfDebug( __METHOD__ . " failed to find page data for title " .
				$this->getTitle()->getPrefixedText() . "\n" );

			// Just for sanity, output for this case is done by showMissingArticle().
			$this->fetchResult = Status::newFatal( 'noarticletext' );
			$this->applyContentOverride( $this->makeFetchErrorContent() );
			return null;
		}
	…

But I don't know enough about how MediaWiki works (or PHP in general, really) to figure out what's going wrong.

This problem likely started after an upgrade that I struggled with. Unfortunately, I didn't notice this problem until long after the upgrade, and when I finished the upgrade I had thought everything turned out okay, so I don't remember exactly what went wrong.

The upshot is that there are a bunch of pages (this was just one example) whose contents exist in the database but can't be accessed through the website. I'm not sure even how to systematically identify such pages. I suspect some rows or values are just missing from some table(s), but I have no clue which or how to find out.

Thoughts?

Nikerabbit (talkcontribs)

Do you have backups from before the upgrade?

It is most likely that either the actor or comments migration has gone wrong. MediaWiki does a LEFT JOIN on those tables so missing entries in there will cause those revisions/pages to appear as missing.

If it is about comments, see https://phabricator.wikimedia.org/T249904.

If it is about actors, I had the following trick:

  1. identify the user names for those revisions
  2. Create proper users for them, e.g. `User::newSystemUser( '...', [ 'steal' => true ] );`
  3. Run database queries UPDATE revision SET rev_user = 0 where rev_user_name = '...'; (and similar for all affected tables, mostly logging, archive and recentchanges)
  4. Run php maintenance/cleanupUsersWithNoId.php


But you need backups to do this in case the rev_user and equivalent fields are already dropped. I guess it's possible to do it afterwards by updating the rev_actor and equivalent fields too, but I have not done that myself.

Jonahgreenthal (talkcontribs)

I do have backups from before the upgrade, but the upgrade was about a year ago so restoring from the backup isn't viable.

Thanks for pointing me at revision_comment_temp and revision_actor_temp. It looks like the problem is the latter—this query returns 164 rows:

SELECT * FROM revision WHERE rev_id NOT IN (SELECT revactor_rev FROM revision_actor_temp)

Do you agree with that reasoning? (Some of the corresponding pages do exist, but the revisions seem to be missing when I view the history through the web interface.)

The rev_user_text column contains the username, so that should address your step 1, right? Are you able to elaborate on step 2 (how do I do that? what's the steal thing?) and 3 (which tables are affected?)? Thanks so much!

Nikerabbit (talkcontribs)

I'd suggest running `php maintenance/migrateActors.php --force` to observe if there are errors. If there is, you should get list of usernames that match the rev_user_text of those rows. You could try running cleanupUsersWithNoId.php first or maybe even findMissingActors.php (if you have it) to see if is sufficient.

But if they don't work, my step 2 basically creates and user and actor for the name. The issue may be that there is no used account for the name, so actor cannot be created. Step 3 removes broken references to user ids which do not exist, so that cleanupUsersWithNoId can process it. The relevant tables and names should be printed out by the migrateActors script.

Jonahgreenthal (talkcontribs)

Thanks. migrateActors produced a bunch of messages like this:

User name "X" is usable, cannot create an anonymous actor for it. Run maintenance/cleanupUsersWithNoId.php to fix this situation.

cleanupUsersWithNoId produced a bunch of output but didn't seem to actually do anything.

I don't know how to actually do your step 2. It looks like PHP code I'm supposed to run, but I don't know how to run custom code within the MediaWiki environment.

I don't have findMissingActors.

Nikerabbit (talkcontribs)

There is shell.php and eval.php under maintenance, both allow you to run that code interactively.

Jonahgreenthal (talkcontribs)

Thanks. I had to fight with shell.php pretty hard to get PsySH to work, but I think everything works now, including the solution of my original problem. I appreciate your help.

Reply to "Missing pages, but data appear to be intact"
Jonathan3 (talkcontribs)

I noticed a recent comment by Ammarpad in "Issues after updating wiki to latest version" linking to phab:T263911, which ends with a comment stating that the following is not needed any more:

if( defined( 'MW_INSTALL_PATH' ) ) {
    $IP = MW_INSTALL_PATH;
} else {
    $IP = dirname( __FILE__ );
}

$path = array( $IP, "$IP/includes", "$IP/languages" );
set_include_path( implode( PATH_SEPARATOR, $path ) . PATH_SEPARATOR . get_include_path() );

require_once( "$IP/includes/DefaultSettings.php" );

if ( $wgCommandLineMode ) {
    if ( isset( $_SERVER ) && array_key_exists( 'REQUEST_METHOD', $_SERVER ) ) {
        die( "This script must be run from the command line\n" );
    }
}

I still have all this (though no known problems arising). Is there an easy way to get a fresh LocalSettings.php for adding my site settings to again? I've not cleaned it out since installing version 1.5 or 1.6...

Ammarpad (talkcontribs)

You usually do that by deleting the existing LocalSettings.php before upgrading (or preferably by moving it to somewhere else so that you can restore any custom settings you might have later). The installer looks for it at its default location and if it's there, it won't be regenerated.

Jonathan3 (talkcontribs)

I see now. I think I followed the instructions each time which now say:

After extracting the tarball, you should copy or move some files and folders from the old installation directory to the new one:

  • LocalSettings.php, which contains your old configuration settings.

...

Run the update script

Next time I upgrade should I run upgrade.php without my old LocalSettings.php file, then merge the old and newly-created files into one file containing the current "boilerplate" stuff plus the necessary settings (database credentials, skins, extensions etc) from the old file?

Ammarpad (talkcontribs)

Yes

Reply to "Update LocalSettings.php"
172.83.47.216 (talkcontribs)

After upgrading from 1.34 to 1.35 I have several pages that won't display anymore.

I get a "There is currently no text in this page." message.

When I navigate to the Category for those pages I see they are all prepended with

"Special:Badtitle/NS108"

Any suggestions on how to fix this?

Bawolff (talkcontribs)

do you have a namespace with id number 108 defined? You probably should.

Ammarpad (talkcontribs)

Extension_default_namespaces#Semantic_MediaWiki suggests Semantic MediaWiki Concept's namespace uses the id. If you didn't create the namespace manually (for instance with $wgExtraNamespaces), that probably means you used to have SM and now you uninstalled it. You've to redefine the namespace, and then either move the pages and then remove the namespace/or extension that provides it again or continue using the namespace name. In short deleting namespace is not yet straightforward.

Reply to "Special:Badtitle/NS108"

error of Legacy vector skin due to update on Japan Uncyclopedia

2
118.238.248.231 (talkcontribs)

hello.I'm member of Japan Uncyclopedia. After to due to Mediawiki update,on our website,the Legacy Vector Skin is causing display error. We found that the errors are caused when some conditions which are ”The user is logged in“, “The user has set the skin to "vector" and turned on the "use legacy vector" setting“,“4 or more table of contents have been on one page“,”There is no "<ref> <reference />"on one page“. so,would you like to make MediaWiki version 1.35 compatible with legacy vector skin?

Bawolff (talkcontribs)

you need to talk to whomever runs uncyclopedia japan.

Reply to "error of Legacy vector skin due to update on Japan Uncyclopedia"