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

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

Hi,

We know that Vector skin has been modified starting from1.39. I do like the skin except some things. So I would like to keep TOC at the beginning of the page, not moving it to side bar. Is it possible to set it this way?

Reply to "Old style TOC in MW 1.39"

Transclusion at end of a sentence (full stop).

5
193.110.182.11 (talkcontribs)

Hello everybody,


I have checked the help page but didn't find a solution for my problem.


Transclusion - MediaWiki


When I have an optional parameter in dem middle of a sentence it would l write something like this.


The {{{Parameter|rabbits}}} are in the garden.


This construction works when its an optional parameter and when no parameter is given only one space is between the parameter and the rest of the sentence. Like this.


The are in the garden.


however when I try to substitute something at the end of the sentence (in the garden) I would get something like.


"The rabbits are in the garden ." When I'm using the parameter with an space at the beginning, it does not take the space. I tried to do it like


The rabbits are{{{ in the garden}}}. Which results in


The rabbits arein the garden.


Does anybody knows a good solution for this. I would have to create all templates with fullstop at the end when used at the end of a sentence?


Thank you very much.

Bawolff (talkcontribs)

Did you try using   instead of a space?

If that doesn't work, try  

Fhihu (talkcontribs)

Thank you very much Bawolff for your reply,

I tried using the template and before the parameter string I used either &#32 and

&nbsp. But it seems not to work. Is it correct like this

{{Template|Location=&#32in the garden}}.

Thank you very much for your reply.

Bawolff (talkcontribs)

The semicolon is important.

What is the precise thing you are doing?

Because when i tried:

the rabbits are {{{param|in the garden}}}.

I got

The rabbits are in the garden.

With no weird spacing issues.

80.120.111.178 (talkcontribs)

Hello Bawolff, thank you very much for your kind reply.


Yes I forgot the semicolon. Perfect.


When you use a parameter everything is okay.

the rabbits are {{{param|in the garden}}}.

results in:

The rabbits are in the garden.


But when you don't use a parameter (optional) in this case leaving "in the garden" empty

the rabbits are {{{param|}}}.

results in:

The rabbits are .


So between the last letter and the fullstop is a space.


Thats why I thought about creating template like this:


the rabbits are{{{param| in the garden}}}.

which result in

The rabbits are in the garden.


An when I don't use a parameter

the rabbits are{{{param|}}}.

I get

The rabbits are.


Where the fullstop is following the last character. I hope it's understandable what Im trying to achieve.


Greetings.

fhihu

Reply to "Transclusion at end of a sentence (full stop)."
MrJConstantine (talkcontribs)

When I'm trying to create a subpage to the MainPage like this:

http://localhost/wiki/index.php?title=Main_Page/Subpage

the following error pops up:

Error contacting the Parsoid/RESTBase server (HTTP 404)

This did not help. I use IIS on Windows 10.

Here are some lines from the log:

[DBConnection] Wikimedia\Rdbms\LBFactory::destroy: closing connection to database 'localhost'.

[DBConnection] Wikimedia\Rdbms\LBFactory::destroy: closing connection to database 'localhost'.

[http] HTTP complete: POST http://localhost/abwiki/rest.php/localhost/v3/transform/html/to/wikitext/Main_Page%2Fsubpage code=404 size=102 total=0.476158 connect=0.002153

[VisualEditor] ApiParsoidTrait::requestRestbase: Received HTTP 404 from RESTBase

Malyacko (talkcontribs)

This reminds me of the bug report at phab:T269174 which has no solution either...

MrJConstantine (talkcontribs)

@Malyacko According to the documentation:

Allowing VisualEditor on page titles containing slashes

If you are serving MediaWiki from apache2, you will need to add the following to your top level server configuration (often a <VirtualHost> section in /etc/apache2/site-enabled/000-default.conf or similar):

AllowEncodedSlashes NoDecode

But there's nothing here on IIS. Should I even try configuring MediaWiki on IIS, Windows 10? I'm totally confused at the moment.

Tanbirzx (talkcontribs)

In which wiki were you going to create a subpage?

Malyacko (talkcontribs)

@Tanbirzx In their MediaWiki installation, obviously.

MrJConstantine (talkcontribs)
MrJConstantine (talkcontribs)

I added some lines from the log in case it might help. For now it looks like I'm not going to solve those VisualEditor/Parsoid problems.

Tanbirzx (talkcontribs)

@MrJConstantine Maybe mediawiki 1.36.1 is not compatible for Windows 10. At first disable your IIS software then try it again. Because IIS may problematic for mediawiki. Secondly you can try the SourceEditor.

Malyacko (talkcontribs)

@Tanbirzx Please stop posting dubious FUD which makes no sense, e.g. "Maybe mediawiki 1.36.1 is not compatible for Windows 10" or "disable your IIS software". This is not the first time you're posting non-sense here. Thanks.

Tanbirzx (talkcontribs)

@Malyacko I am sorry for reply this actually i don't know much about this problem. I searched a task in phabricator about that but there has nothing. So i reply as i know. I have no idea about IIS. Thanks

MrJConstantine (talkcontribs)

@Tanbirzx If you don't understand what are you talking about, please do not post anything and do not give any advises because by spreading such information not only you are not helping but you confuse people. Thank you.

Tanbirzx (talkcontribs)
MrJConstantine (talkcontribs)

@Tanbirzx According to the documentation IIS 7+ is supported if MW is on Microsoft Windows. How can I try it with IIS disabled if my MediaWiki is hosted on IIS? I don't know how can I create a subpage using SourceEditor.

Reply to "I can't create a subpage."

mediawiki 1.38 upgrade to 1.39

4
5.193.68.230 (talkcontribs)

After upgrading from 1.38 to 1.39

php maintenance/update.php gives error,

Modifying tl_namespace field of table templatelinks...Wikimedia\Rdbms\DBQueryError from line 1618 of /var/www/html/includes/libs/rdbms/database/Database.php: Error 1091: Can't DROP INDEX `PRIMARY`; check that it exists

Function: Wikimedia\Rdbms\Database::sourceFile( /var/www/html/maintenance/archives/patch-templatelinks-tl_title-nullable.sql )

Query: ALTER TABLE  `templatelinks`

DROP  PRIMARY KEY

5.193.68.230 (talkcontribs)

mysql> describe templatelinks;

+-------------------+---------------------+------+-----+---------+-------+

| Field             | Type                | Null | Key | Default | Extra |

+-------------------+---------------------+------+-----+---------+-------+

| tl_from           | int(10) unsigned    | NO   |     | 0       |       |

| tl_namespace      | int(11)             | NO   | MUL | 0       |       |

| tl_title          | varbinary(255)      | NO   |     |         |       |

| tl_from_namespace | int(11)             | NO   | MUL | 0       |       |

| tl_target_id      | bigint(20) unsigned | NO   | MUL | NULL    |       |

+-------------------+---------------------+------+-----+---------+-------+

5.193.68.230 (talkcontribs)

SHOW INDEXES FROM templatelinks;

+---------------+------------+----------------------------------+--------------+-------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+

| Table         | Non_unique | Key_name                         | Seq_in_index | Column_name       | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Ignored |

+---------------+------------+----------------------------------+--------------+-------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+

| templatelinks |          1 | tl_namespace                     |            1 | tl_namespace      | A         |        3300 |     NULL | NULL   |      | BTREE      |         |               | NO      |

| templatelinks |          1 | tl_namespace                     |            2 | tl_title          | A         |     2479612 |     NULL | NULL   |      | BTREE      |         |               | NO      |

| templatelinks |          1 | tl_namespace                     |            3 | tl_from           | A         |    47112645 |     NULL | NULL   |      | BTREE      |         |               | NO      |

| templatelinks |          1 | tl_backlinks_namespace           |            1 | tl_from_namespace | A         |        3686 |     NULL | NULL   |      | BTREE      |         |               | NO      |

| templatelinks |          1 | tl_backlinks_namespace           |            2 | tl_namespace      | A         |       14745 |     NULL | NULL   |      | BTREE      |         |               | NO      |

| templatelinks |          1 | tl_backlinks_namespace           |            3 | tl_title          | A         |     1346075 |     NULL | NULL   |      | BTREE      |         |               | NO      |

| templatelinks |          1 | tl_backlinks_namespace           |            4 | tl_from           | A         |    47112645 |     NULL | NULL   |      | BTREE      |         |               | NO      |

| templatelinks |          1 | tl_target_id                     |            1 | tl_target_id      | A         |     1624573 |     NULL | NULL   |      | BTREE      |         |               | NO      |

| templatelinks |          1 | tl_target_id                     |            2 | tl_from           | A         |    47112645 |     NULL | NULL   |      | BTREE      |         |               | NO      |

| templatelinks |          1 | tl_backlinks_namespace_target_id |            1 | tl_from_namespace | A         |        5130 |     NULL | NULL   |      | BTREE      |         |               | NO      |

| templatelinks |          1 | tl_backlinks_namespace_target_id |            2 | tl_target_id      | A         |      298181 |     NULL | NULL   |      | BTREE      |         |               | NO      |

| templatelinks |          1 | tl_backlinks_namespace_target_id |            3 | tl_from           | A         |    47112645 |     NULL | NULL   |      | BTREE      |         |               | NO      |

+---------------+------------+----------------------------------+--------------+-------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+---------+

5.193.68.230 (talkcontribs)

Do you have any solution for this?

Reply to "mediawiki 1.38 upgrade to 1.39"

Issues with MediaWiki upgrade, spam filters, and email system

3
Abce2 (talkcontribs)

This is in part a continuation of Topic:X0esws1la9svpzmu


Hello,


I'm one of the admins at the independent Bakugan Wiki, and we've been dealing with a few issues for years regarding spam bots, a bug impeding MediaWiki upgrading, and spam filters.


For a while we've been dealing with spam bots, which register to the wiki by the hundreds. We have installed many of the spam extensions we saw on utilized on other similar wikis (ex: RS Wiki), but the bots are still able to get through, with the only thing stopping them an Abuse Filter quick-fix that prevents non-sysop editors from creating pages.


One of our theories on how to fix the issue was to upgrade our MediaWiki version from 1.32 to 1.38, but we then ran into a bug preventing this detailed in the above topic. I lack a deep understanding of database systems, but I will do my best to assist and answer any questions. At the very least, resolving this and upgrading the site would be a good start to fixing the domino line of issues.


Email is probably something we have to resolve on our end, but I just wanted to ensure that there wouldn't be anything to resolve in regards to MediaWiki.


I'd like to get this resolved so that the site can open up to new editors again, and any help is appreciated. Please let me know if I can help in any way or if I've missed something in this question.


Thank you,

Abce2


MediaWiki: 1.32.0

PHP: 7.4.3 (apache2handler)

https://bakugan.wiki/wiki/Special:Version

Bawolff (talkcontribs)

So spam prevention hasn't changed much between versions (unfortunately). Its unlikely an upgrade will help that.

A lot of people report success using extension:ConfirmEdit using QuestyCaptcha. Most spammers try and be generic as possible so get stumped by unique questions as long as you aren't a huge website.

By default email uses the server's email system. Often using manual:$wgSMTP to set an external email sender is more reliable.


Regarding the upgrade: based on what you previously wrote, images were uploaded by real users with valid user_id (img_user), but for some reason img_actor was 0. Which is a bit different than the usual problem people have with the actor migration. Did running migrateActors.php help? Did the script output any errors (or anything else)?

Abce2 (talkcontribs)

Hello, and thank you for the response.


I will definitely look into adding QuestyCaptcha to ConfirmEdit and see how that goes.


Looking through the conversation I had with the user who ran migrateActors.php, it does not appear to have worked or done much, but I will get the details and report back.


Thank you,

Abce2

Reply to "Issues with MediaWiki upgrade, spam filters, and email system"
Luciferindcok (talkcontribs)

Hello

Please suggest me a calendar extension for mediawiki.

It should have color for events, events should last more than one day. should be able to include links. I have tried , Mscalendar and Js calendar.

Js calendar is not showing up any options to add events.

Jonathan3 (talkcontribs)

It depends on what you want it for, but you could use Extension:Cargo. It has a calendar output format.

Luciferindcok (talkcontribs)

thanks you and what all should be added in the wiki text to get the calendar displayed with basic features?

Reply to "Calendar"
BaffledBuffalo (talkcontribs)

I updated our MediaWiki from 1.32 to 1.39. After the login, the following error message appears on all (previously existing) pages: This page does not contain any text at the moment. You can create it, search its title on other pages or view the related logs. Interestingly, Special:AllPages lists all articles. Is this behavior due to a faulty migration of the database? Unfortunately, I don't get any error messages showing me a possible cause of the problem (even after using the debugging toolbar). I would be very happy to receive any suggestions that would help me to solve the problem. Thanks in advance!

Bawolff (talkcontribs)
BaffledBuffalo (talkcontribs)

Thanks! Are there typically any indicators for this? Can I check this manually in the database? Regarding the cleanupUsersWithNoId.php script, I'm not sure how to choose the prefix parameter. What would --prefix '*' do exactly? A look into the script couldn't reveal that (at least for me).

Bawolff (talkcontribs)

The best way you can tell, is through looking at the database, looking at the page table, find the entry for the missing page, look at the page_latest field, find the revision table entry where the rev_id matches the page_latest, and check the rev_actor field. If rev_actor is 0 then this is the problem you have. If it isn't than the problem is something else. If you are using sql, do a query [i havent tested this query] like: SELECT * FROM page WHERE page_title = "Main_Page" and page_namespace=0 left join revision on page_latest = rev_id left join actor on rev_actor=actor_id;


The prefix option just renames users who arent real users to have that prefix.

Some people report best results using cleanupUsersWithNoId is you use it before upgrading, so if you have a backup it might be better to try it before doing the upgrade.

BaffledBuffalo (talkcontribs)

Thanks, that helped! Actually, I could see that all entries of the rev_actor column are 0. Would you still suggest to use the migrateActors.php script as a solution?

The script cleanupUsersWithNoId.php mentioned by you is also mentioned in the manual of migrateActors.php. Unfortunately, it is still not clear to me which value I should choose for the --prefix parameter. Could you please help me again with this?

Regarding migrateActors.php, the manual says that the $wgActorTableSchemaMigrationStage variable has been removed in version 1.39. According to this, I should be able to call the migrateActors.php script without any further action (after the cleanupUsersWithNoId.php has been executed successfully)?

Bawolff (talkcontribs)

Prefix parameter can be anything you want. It is used to distinguish real users from fake users.

These scripts are generally safe to run whenever, if they cant do anything they do nothing, but sometimes they are only effective in older versions.

BaffledBuffalo (talkcontribs)

Thanks! You seem to be right. The two scripts have unfortunately had no effect, as some columns seem to be missing. The output of the cleanupUsersWithNoId.php script is essentially the same as the one mentioned here.

So I suppose it probably makes the most sense to use the backup to restore to version 1.32 and update to LTS version 1.35 first. Do you think I can update directly to version 1.39 afterwards or should I update to more intermediate versions first?

Bawolff (talkcontribs)

I would do the backup, run cleanupUsersWithNoId.php on 1.32, then run migrateActors.php, and then do the upgrade. If the scripts work you can then upgrade directly, i dont think you have to go version by version.

140.180.240.87 (talkcontribs)

Did you guys fix this? Any solution would be much appreciated!!

BaffledBuffalo (talkcontribs)

Not yet, unfortunately.

213.118.97.139 (talkcontribs)

We fixed this by updating the records from table `mw_revision` where `rev_actor` was 0. We've set the `rev_actor` to an existing `actor_id` from the `mw_actor` table

BaffledBuffalo (talkcontribs)

That's great! But how did you know which actor_id to put in the respective rev_actor?

Reply to "Pages seem to be gone"

Variable number of parameters in template?

6
RPI2026F1 (talkcontribs)

How do I make a template that can accept any number of arguments? I want to make a template that will call another template for every argument provided, but I'm not sure if this is possible to do without dropping down to Lua.

Bawolff (talkcontribs)

Its very annoying to do without lua. Its probably possible, but save yourself the headache and just use lua.

RPI2026F1 (talkcontribs)

Seems likely. Is there a guide to learning MediaWiki Lua anywhere?

Bawolff (talkcontribs)

Most of lua is generic, so any tutorial should cover the basics.

There is Lua/Tutorial although i dont think its that great of a tutorial

RPI2026F1 (talkcontribs)

I was more interested in learning the MediaWiki-specific extensions to lua.

Bawolff (talkcontribs)
Reply to "Variable number of parameters in template?"

Extensions not appearing in special verison

7
Ramvenkey6278 (talkcontribs)

Mediawiki not loading any of the extensions, i am trying to add pluggablesso, pluggableauth and samlphp, i couldnt see any of the extensions in Special:Version


Windows 2019

MWIKi 1.35.8

Php 7.3.25

Bawolff (talkcontribs)

What did you put in LocalSettings.php ?

Ramvenkey6278 (talkcontribs)

Tried this first

wfLoadExtension( 'PluggableSSO' );


and then


require_once "$IP/extensions/PluggableSSO\src\PluggableSSO.php";


and upgrade using "mw-config"

Bawolff (talkcontribs)

You should definitely use the wfLoadExtension version, not the require_once.


So what happened when you added the wfLoadExtension? Was there an error, did it show up in special:version?

Ramvenkey6278 (talkcontribs)

Thank you for your reply, i tried both option, No error, it is not showing up in special version.


Now i got only this wfLoadExtension( 'PluggableSSO' );

Bawolff (talkcontribs)

Are you sure you are editing the correct LocalSettings.php?

You can test by putting die("test"); in LocalSettings.php temporarily, which will replace your entire wiki with the word "test" until you remove it from LocalSettings.php

Ramvenkey6278 (talkcontribs)

that is interesting, after adding this line in die("test"); to localsettings.php, still the site is showing up all the contents, not test page.

Reply to "Extensions not appearing in special verison"

global login not established from Incubator into WikiData

2
Wladek92 (talkcontribs)

1. Be logged out on all MediaWiki wikis

2. I login userId/pw to Mediawiki using icon '...' from page => https://www.mediawiki.org/wiki/Localisation/fr ; ok, FR page displayed, connected

3. from mediawiki i access the Incubator page  : Ajouter un wiki dans une nouvelle langue / Manuel d'aide de Wikimedia Incubator => https://incubator.wikimedia.org/wiki/Special:MyLanguage/Help:Manual

4. I access https://incubator.wikimedia.org/wiki/Help:Manual

5. Not logged automatically (no 'reload' popup, ..strange) ; i hit manually ... Login on the Incubator page ; result: ok incubator awakes, connects and reloads the EN page automatically

6. Question 1: why incubator doent present the popup 'Reload the page' to be connected ?

7. Remark 1: I have lost continuity because I request the /fr page and I get the EN one when connected

8. I select the FR page in incubator => https://incubator.wikimedia.org/wiki/Incubator:Wikidata/fr

9. At page bottom (Liens externes / Introduction à Wikidata) i access the wikidata page : => https://www.wikidata.org/wiki/Special:MyLanguage/Wikidata:Introduction

10. nok, wikidata is not awaked; hit '...' and Logon have no effect ; Must redo a manual logon in wikidata (global userID + pw) to be connected in wikidata

11. Question 2: why my declared Central connexion on Meta does not operate/propagate onto wikidata  ?

--Christian 🇫🇷 FR (talk) 12:30, 28 November 2022 (UTC)

Bawolff (talkcontribs)

Web browsers locked down third party cookies which may reduce the effectiveness of the central login.

Reply to "global login not established from Incubator into WikiData"