Project:Support desk

Jump to navigation Jump to search

About this board

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

There are also other places where to askCommunication: IRCCommunication#Chat, mailing listsMailing lists, Wikimedia Developer Support, Q&A, mwusers (unofficial forum) etc.

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

Pages are not updated!! If no body is maintaining it, this site needs to be taken down!!

1
99.166.69.111 (talkcontribs)

Pages are not updated!! If no body is maintaining it, this site needs to be taken down!!

Reply to "Pages are not updated!! If no body is maintaining it, this site needs to be taken down!!"
Johnywhy (talkcontribs)

Any font-picker available for Mediawiki? Could be global or per-user.

I don't want to change the whole skin, just pick a different font.

Extension:FontAwesome does not seem created for that purpose.

Reply to "Font Picker?"
Johnywhy (talkcontribs)

This page explains how to use importScript. But seems to fail on my MW 1.30.

This page has some discussion about deprecation, but seems to conclude that importScript is not deprecated.

This page says to migrate importScript to mw.loader.

The nice thing about importScript is that you can pass a simple page refererence, eg importScript('MyScript.js'). It appears that mw.loader requires a more complicated url-syntax, eg

mw.loader.load( '/w/index.php?title=MyScript.js&action=raw&ctype=text/javascript' );

Is it deprecated, or soon to be?

Reply to "Is importScript Deprecated?"

Restoring mediawiki downloaded from hosted server (company name: namecheap)

11
Flylikeaseagull (talkcontribs)

Hello. I had all of my files on a hosted server downloaded to a large 4 gb zip file.

In localsettings.php it says:

##Database settings
$wgDBtype = "mysql";
$wgDBserver = "localhost";
$wgDBname = "travb_mw229";
$wgDBuser = "travb_mw229";

Where would this file be?


The information on a new account (which would be the same as the previous downloaded account) is this:

Server: Localhost via UNIX socket
Server type: MariaDB
Server version: 10.1.31-MariaDB-cll-lve - MariaDB Server
Protocol version: 10
User: ...@localhost
Server charset: UTF-8 Unicode (utf8)


Web server

cpsrvd 11.70.0.48
Database client version: libmysql - 5.1.73
PHP extension: mysqli curl mbstring
PHP version: 5.6.30
Malyacko (talkcontribs)

In whatever folder you stored your database file. :)

Flylikeaseagull (talkcontribs)

hello @Malyacko where is the default database file on a mediawiki program? I just created a mediawiki using default program, Softaculous on namecheap cpanel. It was created with MediaWiki 1.23.3

Malyacko (talkcontribs)

That depends on the database backend used (MySQL/MariaDB, Postgres, SQLite, MSSQL, to name a few) and how that database is configured. That's lower in the stack than MediaWiki...

Flylikeaseagull (talkcontribs)

thank you for your time sir!

I am really a newbie at this kind of stuff.

What is the database file usually called?

mysql.php?

Ok, I just dragged and dropped all of my files using winscp to my desktop then zipped them. @Malyacko

Softaculous says:

  • Database-driven (MySQL and PostgreSQL are both supported)

In localsettings.php it says:

## Database settings
$wgDBtype = "mysql";
$wgDBserver = "localhost";
$wgDBname = "travb_mw229";
$wgDBuser = "travb_mw229";

Not sure what you mean by lower in the stack - going to assume not important for now :)

Would the database be located in the folder for my mediawiki, which is automatically created when I used Softaculous to automatically create MediaWiki 1.23.3?

THANK YOU FOR YOUR HELP!

Malyacko (talkcontribs)

Alright, that means that you use a MySQL/MariaDB database, and the database has the name "travb_mw229". I do not know what "Softaculous" or "namecheap" is and which operating system they are running and where they save databases by default.

"Would the database be located in the folder for my mediawiki": Usually not, no.

Flylikeaseagull (talkcontribs)

@Malyacko

Hello sir! I rewrote the original question, with a lot more details.

Any suggestions where these databases would be?

Malyacko (talkcontribs)
Flylikeaseagull (talkcontribs)
2001:16B8:10E0:B500:AC31:65A3:AD3F:9360 (talkcontribs)

Hi Flylikeaseagull!

Actually, you are not really having a MediaWiki question. :-)

You already know that you are looking for a MySQL databse and that this database has the name travb_mw229.

What you now need to know is the folder, in which MySQL databases are stored in your backup. Basically this is a question on where MySQL was configured to store databases in this system.

Wargo (talkcontribs)
Reply to "Restoring mediawiki downloaded from hosted server (company name: namecheap)"
Johnywhy (talkcontribs)

Its seems both support HTML/CSS/JS.

Extension:Widgets

Extension:Gadgets

How to choose one over the other? How are they different?

This page says:

  • Gadgets — Lets users select custom CSS and JavaScript gadgets in their preferences.
  • Widgets — Allows wiki administrators to add free-form widgets to the wiki by editing pages within the Widget namespace.

Observations:

  • Not sure what "free-form" means. Both widgets and gadgets are added by admins, so that factor seems the same.
  • I believe widgets are a type of gadget, and the widget feature must be defined on the gadgets-definition page. But that doesn't help me understand the difference between them.
  • Sounds like either one could be a video-player, feed-reader, or any other visual toy embedded on the page.
Ciencia Al Poder (talkcontribs)

Gadgets is for adding scripts and CSS snippets that will be loaded on all pages, for all users or those users that choose to use them in their preferences.

Widgets are HTML fragments that you define (including content that usually isn't allowed in wikitext, like HTML forms, iframes, etc) that can be included on specific pages.

Johnywhy (talkcontribs)
  • A JS gadget may write HTML to a page, but gadgets start with a JS or CSS file (or page), and not an HTML file. Correct?
  • A JS gadget may write HTML that usually isn't allowed in wikitext (like forms, iframes, etc). Correct?
  • A widget starts with raw HTML. That HTML may load CSS or JS. Correct?
Ciencia Al Poder (talkcontribs)

All 3 points are correct

Johnywhy (talkcontribs)

They sound the same, in terms of capabilities (HTML, normally-disallowed HTML, JS, CSS) and permissions-options (global, hidden, user-selected, etc).

Correct?

Only difference between them being:

  • Gadgets start with a JS or CSS file (or page).
  • Widgets start with raw HTML.
Reply to "Gadgets vs Widgets?"

'Internal Error' with 1.31 + Math Extension

2
99.203.5.195 (talkcontribs)

I have a wiki that was just upgraded to 1.31. For testing purposes, I am assuming the wiki has access to the internet.

I downloaded the Math extension from:

https://www.mediawiki.org/w/index.php?title=Special:ExtensionDistributor&extdistname=Math&extdistversion=REL1_31

and de-tarred the file into the 'extensions' directory.

I added to LocalSettings.php the two lines:

wfLoadExtension( 'Math' );

$wgShowExceptionDetails = true;

When I created a page and inserted the code: '<math>ax^2</math>', I had a grievous error, the significance of which I don't understand because I'm not a MediaWiki developer. What's going on?

MediaWiki internal error.

Original exception: [617bcf9d596e3c187a4aad5d] /wiki3/index.php/Sandbox_and_Wiki_Samples Exception from line 420 of /var/www/html/wiki3/includes/libs/MultiHttpClient.php: PHP cURL extension missing. Check https://www.mediawiki.org/wiki/Manual:CURL

Backtrace:

#0 /var/www/html/wiki3/includes/libs/MultiHttpClient.php(149): MultiHttpClient->getCurlMulti()

#1 /var/www/html/wiki3/includes/libs/virtualrest/VirtualRESTServiceClient.php(249): MultiHttpClient->runMulti(array)

#2 /var/www/html/wiki3/extensions/Math/MathRestbaseInterface.php(151): VirtualRESTServiceClient->runMulti(array)

#3 /var/www/html/wiki3/extensions/Math/MathMathML.php(61): MathRestbaseInterface::batchEvaluate(array)

#4 /var/www/html/wiki3/extensions/Math/MathHooks.php(384): MathMathML::batchEvaluate(array)

#5 /var/www/html/wiki3/includes/Hooks.php(177): MathHooks::onParserAfterTidy(Parser, string)

#6 /var/www/html/wiki3/includes/Hooks.php(205): Hooks::callHook(string, array, array, NULL)

#7 /var/www/html/wiki3/includes/parser/Parser.php(1428): Hooks::run(string, array)

#8 /var/www/html/wiki3/includes/parser/Parser.php(446): Parser->internalParseHalfParsed(string, boolean, boolean)

#9 /var/www/html/wiki3/includes/content/WikitextContent.php(323): Parser->parse(string, Title, ParserOptions, boolean, boolean, integer)

#10 /var/www/html/wiki3/includes/content/AbstractContent.php(516): WikitextContent->fillParserOutput(Title, integer, ParserOptions, boolean, ParserOutput)

#11 /var/www/html/wiki3/includes/poolcounter/PoolWorkArticleView.php(144): AbstractContent->getParserOutput(Title, integer, ParserOptions)

#12 /var/www/html/wiki3/includes/poolcounter/PoolCounterWork.php(123): PoolWorkArticleView->doWork()

#13 /var/www/html/wiki3/includes/page/Article.php(604): PoolCounterWork->execute()

#14 /var/www/html/wiki3/includes/actions/ViewAction.php(68): Article->view()

#15 /var/www/html/wiki3/includes/MediaWiki.php(500): ViewAction->show()

#16 /var/www/html/wiki3/includes/MediaWiki.php(294): MediaWiki->performAction(Article, Title)

#17 /var/www/html/wiki3/includes/MediaWiki.php(861): MediaWiki->performRequest()

#18 /var/www/html/wiki3/includes/MediaWiki.php(524): MediaWiki->main()

#19 /var/www/html/wiki3/index.php(42): MediaWiki->run()

#20 {main}

Exception caught inside exception handler: [617bcf9d596e3c187a4aad5d] /wiki3/index.php/Sandbox_and_Wiki_Samples Exception from line 420 of /var/www/html/wiki3/includes/libs/MultiHttpClient.php: PHP cURL extension missing. Check https://www.mediawiki.org/wiki/Manual:CURL

Backtrace:

#0 /var/www/html/wiki3/includes/libs/MultiHttpClient.php(149): MultiHttpClient->getCurlMulti()

#1 /var/www/html/wiki3/includes/libs/virtualrest/VirtualRESTServiceClient.php(249): MultiHttpClient->runMulti(array)

#2 /var/www/html/wiki3/extensions/Math/MathRestbaseInterface.php(151): VirtualRESTServiceClient->runMulti(array)

#3 /var/www/html/wiki3/extensions/Math/MathMathML.php(61): MathRestbaseInterface::batchEvaluate(array)

#4 /var/www/html/wiki3/extensions/Math/MathHooks.php(384): MathMathML::batchEvaluate(array)

#5 /var/www/html/wiki3/includes/Hooks.php(177): MathHooks::onParserAfterTidy(Parser, string)

#6 /var/www/html/wiki3/includes/Hooks.php(205): Hooks::callHook(string, array, array, NULL)

#7 /var/www/html/wiki3/includes/parser/Parser.php(1428): Hooks::run(string, array)

#8 /var/www/html/wiki3/includes/parser/Parser.php(446): Parser->internalParseHalfParsed(string, boolean, boolean)

#9 /var/www/html/wiki3/includes/cache/MessageCache.php(1158): Parser->parse(string, Title, ParserOptions, boolean)

#10 /var/www/html/wiki3/includes/Message.php(1244): MessageCache->parse(string, Title, boolean, boolean, LanguageEn)

#11 /var/www/html/wiki3/includes/Message.php(869): Message->parseText(string)

#12 /var/www/html/wiki3/includes/Message.php(922): Message->toString(string)

#13 /var/www/html/wiki3/includes/skins/Skin.php(682): Message->parse()

#14 /var/www/html/wiki3/includes/skins/SkinTemplate.php(462): Skin->printSource()

#15 /var/www/html/wiki3/includes/skins/SkinTemplate.php(249): SkinTemplate->prepareQuickTemplate()

#16 /var/www/html/wiki3/includes/OutputPage.php(2388): SkinTemplate->outputPage()

#17 /var/www/html/wiki3/includes/exception/MWExceptionRenderer.php(135): OutputPage->output()

#18 /var/www/html/wiki3/includes/exception/MWExceptionRenderer.php(54): MWExceptionRenderer::reportHTML(Exception)

#19 /var/www/html/wiki3/includes/exception/MWExceptionHandler.php(75): MWExceptionRenderer::output(Exception, integer)

#20 /var/www/html/wiki3/includes/exception/MWExceptionHandler.php(149): MWExceptionHandler::report(Exception)

#21 /var/www/html/wiki3/includes/MediaWiki.php(551): MWExceptionHandler::handleException(Exception)

#22 /var/www/html/wiki3/index.php(42): MediaWiki->run()

#23 {main}

99.203.5.195 (talkcontribs)

I am able to reproduce this on a freshly installed wiki. The extension is broken. Somebody who knows who's in charge of these sorts of problems needs to find out about this.

Reply to "'Internal Error' with 1.31 + Math Extension"

How to Render Template in Javascript?

17
Johnywhy (talkcontribs)

Can javascript retrieve the rendered, rich-text output of a template? Ie, formatted text, not raw HTML.

137.147.0.130 (talkcontribs)
Johnywhy (talkcontribs)

The Parse API doesn't get rendered output. It gets the HTML parsed from wikitext. Tho' for my purpose, that would be fine. This works

https://gunretort.xyz/api.php?action=parse&text={{Tag|Pie|}}&contentmodel=wikitext

Of course, then returned json or xml has to be parsed or queried. I'm pretty sure jquery can handle that.

Johnywhy (talkcontribs)

Here's one method. Kinda hacky, but it works. Might be slow too. This is for parameterized templates:

  1. Install Extension:UrlGetParameters
  2. Replace the parameters in your template with a query string.
    replace:
    {{{1}}}
    
    with:
    {{#urlget:Tag}}
  3. instead of getting called as an internal transclude with pipes, it will be called as a fully-qualified url with url-parameters:
    instead of:
    {{MyTemplate|MyParameter}}
    
    call with
    https://MyWiki.xyz/index.php/Template:MyTemplate?MyParameter=SomeValue
  4. append &action=render to the url, so you exclude the headers and sidebar, and only get the rendered body of the template (the part that would normally be transcluded).
    https://MyWiki.xyz/index.php/Template:MyTemplate?MyParameter=SomeValue&action=render
  5. Retrieve this url in your javascript, with an XMLHttpRequest.
    xmlhttp=new XMLHttpRequest();
    xmlhttp.open("GET", "/index.php/Template:MyTemplate?action=render&MyParameter=" + sSomeValue, false);
    xmlhttp.send();
    var sTemplateOutput = xmlhttp.responseText;
    
    // optional strip HTML formatting, and get just the plain text
    var sPlainText = $(sDescription).text();
    
137.147.0.130 (talkcontribs)

The Parse API returns the HTML parsed from wikitext, which IS the rendered output. And your solution does exactly the same thing... so what's the actual problem here?

Johnywhy (talkcontribs)

It seems the parse api can only return json or xml structured data. My solution returns just the rendered page body.

137.147.0.130 (talkcontribs)

Yeah, and the JSON contains the HTML. If you really don't want to work with JSON for some reason, the mw.Api.parse plugin just returns the HTML.

Johnywhy (talkcontribs)
Ciencia Al Poder (talkcontribs)
Johnywhy (talkcontribs)

page says (removed in 1.32) Gerrit change 434179

  • Unclear if that means the given JS is deprecated in 1.32
  • Is something replacing it?
var api = new mw.Api();

api.parse( "'''Hello world'''" )
.done( function ( html ) {
	console.log( 'Parsed result:', html );
} );
  • What's difference between new mw.Api() and new mediaWiki.Api()?
Ciencia Al Poder (talkcontribs)

The resource loader module mediawiki.api.parse is deprecated. In this case, the code is merged into mediawiki.api, which means you only need to have the mediawiki.api resource loader module loaded for using this.

mw is a shorthand alias for mediaWiki, so basically both constructs are equivalent.

Johnywhy (talkcontribs)
"you only need to have the mediawiki.api resource loader module loaded for using this."

Do i need to do something to have that? Or is it available in a core install by default? v1.30

Does the given Javascript represent the non-deprecated style?

Sorry if these questions are already answered in the doc, it's unclear to me.

Ciencia Al Poder (talkcontribs)

To make sure the module loads before your code runs, there's mw.loader.using.

mw.loader.using( 'mediawiki.api' ).then( function () {
    var api = new mw.Api();

    api.parse( "'''Hello world'''" )
        .done( function ( html ) {
    console.log( 'Parsed result:', html );
    } );
} );

That Javascript is totally fine.

Johnywhy (talkcontribs)

do i definitely need to do `using` statement?

i can already run the following code without the using statement. Doesn't that prove the mw module is loaded, and therefor parse will work out-of-the-box, without `using`?

var api = new mediaWiki.Api();

    api.postWithToken( "edit", {
        action: "edit",
        title: "Portal:TagDescriptions",
        section: "new",
        text: sNewDescription,
        sectiontitle: sTag
    } )
Ciencia Al Poder (talkcontribs)

This will only work if the mediawiki.api module is loaded at the time your code runs. It may work because there may be some features on the page already using it and loading it before your code runs. However, this may not work on other pages. To be safe, wrap your code in mw.loader.using statements when using modules that are not loaded by default.

Johnywhy (talkcontribs)

is there a list of modules that are loaded by default?

This page states

"The modules jquery and mediawiki together form the base environment ("startup") and are always present. They should not (and in fact, can not) be loaded as modules or dependencies."

Doesn't that mean mediawiki.api is automatically loaded?

Ciencia Al Poder (talkcontribs)

No, mediawiki.api is a different module than mediawiki. Hence, you usually need to load it explicitly.

Reply to "How to Render Template in Javascript?"
Biologically (talkcontribs)

How to create forums like this MediaWiki Support desk?

In other words what extensions, templates, etc. MediaWiki uses to create this Support desk?

I tried to find related extensions in the Special:version page of MediaWIki, but couldn't find anything. Another problem I noted is that when I click the discussion link on the support desk (Project talk:Support desk) it opens the same topics posted in this main page (Project:Support desk). Can someone please tell me is this a bug?

AhmadF.Cheema (talkcontribs)

Extension:StructuredDiscussions

The discussion page peculiarity shouldn't be a bug, it has a redirect link to this page, although am not sure why the redirect link works here slightly differently than normal.

Reply to "Creating "Support desk"-style forum"
Sneha.1812 (talkcontribs)

Hello, Can anyone please help w.r.t how can we search for text in an uploaded document in Media Wiki?

Malyacko (talkcontribs)

What kind of "uploaded document"? Which MediaWiki version?

Sneha.1812 (talkcontribs)

Uploaded documents can be Word Documents, pdfs, Excels, Popwer points. Mediawiki 1.3.0.

Pls let me know for any further queries.

Sneha.1812 (talkcontribs)

Hello , Can someone pls respond to the query, using Media wiki version 1.30.

Reply to "Search"
46.235.152.9 (talkcontribs)

If there is a common keyword which is searched in media wiki and retrieves multiple records since the keyword is common, can you pl help in clarifying what is the logic for search results? Is the most recently edited page comes first in the list of the page with most hits comes first.

Sneha.1812 (talkcontribs)

Hello,

Can anyone pls throw some light on this query.

Thanks

Reply to "Logic of Search"