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

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

Looking at Manual:Upgrading, it seems that upgrading from 1.32 to 1.37.1 will be easy.

I have downloaded the entire set of files and my host has multiple backups. Is there a way to find out what extensions I have? It was several years ago when the initial configuration was done and I want to be ready if something goes bad.

Reply to "Upgrading from 1.32 to 1.37.1"

Unparenthesized `a ? b : c ?: d` is not supported

3
Salas58 (talkcontribs)

Today when I opened my Wiki, I got the following error:

Fatal error: Unparenthesized `a ? b : c ?: d` is not supported. Use either `(a ? b : c) ?: d` or `a ? b : (c ?: d)` in /var/www/lutwik.com/includes/page/Article.php on line 822

I found the following code starting on line 822 of that file:

$pOutput = ( $outputDone instanceof ParserOutput )

// phpcs:ignore MediaWiki.Usage.NestedInlineTernary.UnparenthesizedTernary -- FIXME T203805

? $outputDone // object fetched by hook

: $this->mParserOutput ?: null; // ParserOutput or null, avoid false

I added parens to the last line, which I think is what I'm supposed to do:

: ($this->mParserOutput ?: null);

but I still get the same error.

Stack Overflow has a couple of entries about this: https://stackoverflow.com/questions/61432488/php-error-unparenthesized-a-b-c-d-e-is-deprecated-use-either-a?noredirect=1&lq=1, but I think I did it correctly.

How can I fix this?

Bawolff (talkcontribs)

Upgrade to at least mediawiki 1.33

Salas58 (talkcontribs)

It turned out my host had upgraded PHP to 8.0. Downgrading solved the issue.

Reply to "Unparenthesized `a ? b : c ?: d` is not supported"

How could I make MediaWiki refer to each page by type and id number?

6
Guillaume Taillefer (talkcontribs)

Hello all,

I am currently trying to create a website that uses MediaWiki which will have certain articles that will have the same exact name as another or others (this mainly includes names of people among other things).

I wanted to know if it was possible for me to separate each kind of page (User pages, Multimedia pages, normal pages/articles, etc) in the pages table so that I could make MediaWiki refer by default to each kind of page separately and by their id number (especially in the url), and the User Pages so that they refer to the User id number instead of its page_id.

So for example if I wanted to go to the profile page of user number 45, the url would be example.com/index.php?User:id=45, or for articles: /index.php?Article:id=2364, or for /index.php?Multimedia:id=52 (this is just a hypothetical for what the url would be, so not what it might look like). And this would occur by default so if you went to the website domain it would just redirect to example.com/index.php?Page:id=1 or something for Main_Page.

The reason for this is because, as I said above, the site will include pages that will have the same title/text name (such as a name like John Smith), and there will be too many to just use Wikipedia’s method of adding parentheses or some other to the name to be more specific. In general this would allow things to be more organized as well. I had asked before if there was any way that I could start making MediaWiki refer (especially in the url) to each page by their page_id instead of their name and someone responded with just using index.php?curid=1 to get to whatever page had that id number. And this seemed to somewhat work until I realized that this also included user and multimedia pages which as I said I would like to identify by a separate id number (by the actual id number of the user for the User pages and file id number or something).

If anyone could tell me how to go about doing this I would be thankful, Thanks.

Samwilson (talkcontribs)

One way you could do it would be to create each page with an ID number, and then use the Display Title extension to change the title that gets displayed. That wouldn't be great for user pages, and for files they'd appear as e.g. File:123.jpg. Also, if you use Page Forms, it has a mechanism for adding sequential integers to page titles.

I think actually I'm not quite understanding your motivation though… :)

Guillaume Taillefer (talkcontribs)

Thank you for the response, I don't think that would really work that well for the reasons that you said among others. What I want is MediaWiki to identify each page by their id number, and not their name. I want to also identify and distinguish each page by type so that if I wanted to request for a specific article by id number, I would get the article that has that id number regardless of what name it has and whether there are other articles that have the same name/title. For example, if I requested for a page by: index.php?Article:id=50, it would give me an article, not a Multimedia page or User page that has the id number of 50. if I requested for index.php?User:id=50, instead of giving me Article:id=50, it would give me the user profile page of the user with the id of 50. The same goes with Multimedia pages.

If there was an Article with the id number of 61 and had the title of "Gaius Julius Caesar", and I requested it by doing index.php?Article:id=61, it would give me the article with the title of Gaius Julius Caesar.

I also made the mistake of not saying this but I want to also create a system of using multiple languages similar to what Wikipedia does (How I will create that system isn't relevant to the question right now) if it helps. Here every single language version of each article is tied to its id number, which links it to the other language versions. so Article 61 in the english version will be the same exact subject as Article 61 in the french, german, spanish, japanese, chinese, etc versions of the website.

Bawolff (talkcontribs)

You can also use ?curid=1234 to refer to articles by their page_id.


You could maybe do something with manual:hooks/InitializeArticleMaybeRedirect but that would be really complex

However it sounds a bit like you are trying to force a square peg in a round hole.

Guillaume Taillefer (talkcontribs)

Thanks for the response, I had already said that someone suggested to me to try and use curid but as I said this doesn't set MediaWiki by default to look for pages based on their id instead of their name. You are right that this whole thing seems like it is forcing a square into a circular hole but as Ive seen MediaWiki is modifyable so I just need to know how to get there, if as easily as possible.

Samwilson (talkcontribs)

There are user IDs and page IDs, which could conceivably be used in URLs (e.g. they're available for Special:Redirect), but if you want per-namespace IDs I'm not sure what you could use — everything's a page, and so share the same ID space. Do you really need to support File:id=50 and Article:id=50?

I was going to say you could figure out some sort of URL rewriting, but that'll only work in one direction and would be harder to get working to ensure there's only one canonical form of each URL (i.e. redirecting from title-URL to ID-URL). I wonder if the best solution might not be a custom extension (although you'll still have to figure out what IDs you're using and, if they don't already exist, create them somehow).

Reply to "How could I make MediaWiki refer to each page by type and id number?"
71.218.98.92 (talkcontribs)

I'm trying to accomplish something similar to the Minecraft wiki, where they use 1 large image with thousands of tiny sprites, only rendering a small section of the image, instead of uploading thousands of images. However, I see that the SpriteSheet extension Extension:SpriteSheet is no longer updated and doesn't work on the newest version. It appears the Minecraft wiki uses a whole bunch of templates, modules, and widgets, and I tried copying them to my wiki, however this didn't seem to work. Are there any other alternatives to accomplish this?


Thanks!

Reply to "Image Sprite Sheets"

How to implement the product of a page builder in MediaWiki?

4
109.64.133.223 (talkcontribs)

MediaWiki 1.36.1.

I often work with page builders (Elementor/Gutenberg) to make responsive layout development automation for webpages but sadly such solutions aren't currently available for MediaWiki.

I would like to save web pages created with Elementor/Gutenberg (or any other Page Builder software for that matter) as HTML with everything (all their JavaScript, CSS and images) and then including them in MediaWiki.

Fore example, I would desire to somehow replace the homepage in a MediaWiki website (or, it's inner content), with a webpage developed with Elementor or Gutenberg in Drupal.

I could go to a webpage created in Elementor in my browser, click on "Save as HTML" but then what?

How to implement the webpage (or part of it) inside MediaWiki, preferably in a total conversaion way (everything, including the logo/menus/search box/heading will be replaced).

Malyacko (talkcontribs)

Why do you want to use MediaWiki for this, instead of for example Drupal?

79.176.222.75 (talkcontribs)

@Malyacko

Any article in my website should be MediaWiki, but I got to do somehow make the homepage to seem a bit more "attractive".

Malyacko (talkcontribs)
Reply to "How to implement the product of a page builder in MediaWiki?"

Visual Editor does not Show Recent Uploads List to Insert an Image

1
Bccrowe (talkcontribs)

MediaWiki 1.37.1 (Mac OS Monterey, install in place with MAMP, standard set of extensions)

Mac OS 12.1, MAMP 6.6 (1211), PHP Apache 7.4.21, MySQL 5.7.34

I am new with just a few days playing with MediaWiki. I am trying to create a media-rich wiki. File uploads work, and Special Pages show the related file statistics correctly. Using the Visual Editor, when I select: Insert -> Image, the table to select a recent uploaded image to insert is empty. If I use the Source Editor, I can successfully add the image explicitly. Any idea about why this is not quite working? Is there a privilege setting I need to make somewhere?

Thanks to anyone who can help me!

Reply to "Visual Editor does not Show Recent Uploads List to Insert an Image"
85.99.180.213 (talkcontribs)

Sayfamda yapmış olduğum düzeltmeler için sürekli "inceleniyor" mesajı var. Değiştirdiğim resim üçüncü şahısların araması sırasında gösterilen sayfada görünmüyor. Nasıl düzeltebilirim bu aksaklığı?

Malyacko (talkcontribs)

Please see "Post a new question" in the sidebar.

Reply to "İnceleme sorunu???"

Question about LDAP Usage on Special site / Create new user Account

2
91.38.157.210 (talkcontribs)

Hi,

I have a question about creating new Users for my restricted Mediawiki. I setup the Wiki with LDAP Authentication. Everything works fine and the user can login with their LDAP (Active Directory) Accounts. When I now want to authorize new LDAP Users on the Special Site – Create new User Account I am not able to “browse” the LDAP Directory to search for the new users. I can put the name into the field and then the User can login, but I would be nice if I could integrate an LDAP browser. I already searched but didn’t find something that points me to the right direction. Can this behavior be archived?


OS: CentOS 8

Mediawiki Version 1.36

MySQL Server 7.4.26

Apache WebServer 2.4.37


Extensions:

LDAPAuthentication2

LDAPAuthorization

LDAPGroups

LDAPProvider

LDAPUserInfo

OAuth

ParserFunctions

PluggableAuth

91.38.157.210 (talkcontribs)

Has nobody an idea on this or do you need more information?

Reply to "Question about LDAP Usage on Special site / Create new user Account"

Why is "Content pages" in Special:Statistics 0?

8
AnonymousStackOverflow (talkcontribs)

MediaWiki version: 1.37.0

PHP version: 8.0.13

SQLite version: 3.33.0

When I go to Special:Statistics, "Content pages" is 0 even though I have some mainspace pages, and so is "Active users". All other values are correct.

The incorrect statistics page
Active users page showing more then 0 active users
All pages which shows that I have more then 0 mainspace pages
Malyacko (talkcontribs)
AnonymousStackOverflow (talkcontribs)

I set the value to "any" and it still isn't working. It also doesn't explain why the active users count is 0.

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

That fixed the content pages, but didn't fix active users.

Samwilson (talkcontribs)

There's a separate --active flag for that:

php maintenance/initSiteStats.php --update --active
This post was hidden by AnonymousStackOverflow (history)
Reply to "Why is "Content pages" in Special:Statistics 0?"

How to can I use wordpress blog with mediawiki in same ip

4
180.230.13.129 (talkcontribs)

I use ubuntu 20.04, apache2, mediawiki, php 8.0.

I was used to mediawiki spesific domain.

and today I want to open wordpress blog same my mediawiki's ip for save money.

I already installed my wordpress files, dns setting goods, sites-available already settings alright, blog floder files locate alright, https done.

but when I enter my blog domain on the browser, connected 'my mediawiki domain'.

I don't know why this happen like this. Can't help google with me.

How do I make my blog's domain appear when I enter my domain in the browser?

Bawolff (talkcontribs)

Your webserver virtualhost settings are probably incorrect.

180.230.13.129 (talkcontribs)

This is writer. I solved this problem myself. I check with command 'a2query -s' and I edited. It's all worked I want to.

Reply to "How to can I use wordpress blog with mediawiki in same ip"