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

Populating multiple template arguments via a parser function

2
EliteMasterEric (talkcontribs)

I'm trying to use a parser hook to produce several arguments of a template, but it's not recognizing them as arguments.

My input:

{{Navbox
|state     = uncollapsed
|name      = {{subst:PAGENAME}}
|title     = [[Troops]]
|listclass = hlist
{{#arraymap:Test One~Test Two~Test Three|~|x|{{!}}group1{{=}}x{{!}}list1{{=}}Test|}}
}}

Intended result:

{{Navbox
|state     = uncollapsed
|name      = {{subst:PAGENAME}}
|title     = [[Troops]]
|listclass = hlist
|group1=Title One
|list1=Test
|group1=Title Two
|list1=Test
|group1=Title Three
|list1=Test
}}

The issue is that the Navbox appears to be parsing the |group1=Title One|list1=Test|group1=Title Two|list1=Test|group1=Title Three|list1=Test part as a single string rather than several template arguments. How do I get it to do this properly?

P.S. I know the groups will override each other, this is an example.

EliteMasterEric (talkcontribs)

I have discovered the page Halo Esports Gamepedia: Template:OrgNavbox , which builds a navbox dynamically using a Lua module invocation. This is what I am moving to.

Murphy013 (talkcontribs)

Hi

I read Wiki information and found no way to resize a framed image. Who can help? Or is it possible to get a caption for resizable images? I found only thumbnails, but I don’t wanna use this way.

Best

Reply to "Resize framed images"
Alzi24 (talkcontribs)

Hello there! Is there any help or manual page about the "printable version" function? I can't find anything when searching with "print", "printable" and similar keywords.

AhmadF.Cheema (talkcontribs)
Alzi24 (talkcontribs)

Hah! I did not consider looking up the WP documentation, have always been searching around here at mediawiki.org. Thank you!

Reply to "Printable version"

Is it possible to redirect if the user forgets the "/wiki"?

10
Semako96 (talkcontribs)

Is it possible to create an .htacess redirect that redirects to "/wiki/if the user forgets it, ie from domain.tld/article to domain.tld/wiki/article? Just a general redirect won't work of course, because the /w/ directory needs to be accessible, but I am so bad when it comes to .htaccess stuff... ;-)

MarkAHershberger (talkcontribs)

Try adding the following the (untested) code to end of your .htaccess file

RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/wiki/$1
Semako96 (talkcontribs)

Thanks, that always redirects to the wiki's main page instead of just adding the /wiki/ if someone forgets it.

MarkAHershberger (talkcontribs)

It should also redirect yourwiki.com/GiveMeAPrefix to yourwiki.com/wiki/GiveMeAPrefix.

Semako96 (talkcontribs)
MarkAHershberger (talkcontribs)

If you have something after my rule, then you should add [L] to the end of the RewriteRule line so that none of the other rules are executed.

2A02:8388:6982:B700:CC4E:BC56:9C2:A192 (talkcontribs)

Still only redirects to main page.

Current .htaccess is:

## http://www.mediawiki.org/wiki/Manual:Short_URL/Apache

# Enable the rewrite engine
RewriteEngine On

# Short URL for wiki pages
RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]

# Redirect / to Main Page
RewriteRule ^/*$ %{DOCUMENT_ROOT}/w/index.php [L]

RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/wiki/$1 [L]

############HTACCESS W4Y START############
Order Allow,Deny
Allow from all
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} mariowiki.net
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
#############HTACCESS W4Y END#############
Semako96 (talkcontribs)

The message above me was mine, I didn't notice that I got logged out, sorry.

MarkAHershberger (talkcontribs)

Ok, thanks for posting that.

This is what I've tested and found works:

RewriteCond %{REQUEST_URI} !^/wiki/
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^/?(.*)$ /wiki/$1 [R=301,L]
Semako96 (talkcontribs)

yes, that does work. Thank you!

Reply to "Is it possible to redirect if the user forgets the "/wiki"?"
Murphy013 (talkcontribs)

hi all


in a wikitable I'm showing some rows dynamic, e.g.

! class="showEntry" | table-vale <ref>reference text</ref>

and show at the end of table references using <references />

the reference is always shown.

how can i supress the reference when the row is not shown?

regards

Ciencia Al Poder (talkcontribs)

If you display/hide the row with JavaScript, you'll need to modify that JavaScript to find a reference on the row being hidden/shown and do the same on the corresponding reference text.

Reply to "Dynamic references"
Semako96 (talkcontribs)

I need to reset the passwort of the account I use for my bot in my wiki, since I forgot it a long time ago. As I forgot to set an email adress and can't use the maintenance script, I need to do it via the DB (of course backed up the table in question before trying anything). The SQL command looks like that

UPDATE `user` SET user_password = CONCAT(':pbkdf2:sha256:10000:128:', 'another-string', 'another-key') WHERE user_name = 'someuser';

according to Manual:Resetting passwords, but I don't know what I need to insert as 'another-string' and 'another key'. It would be enough to set an one-letter-password to allow me to log in with that account and change it afterwards.

Can someone help me?

MarkAHershberger (talkcontribs)

If you can update the db, why not provide an email for the user and just recover it that way?

Semako96 (talkcontribs)

Yeah, I am so dumb, I should have known that easy way to do that. Done, I can use that account again ;)

Alzi24 (talkcontribs)
Software 	Version
MediaWiki 	1.31.1
PHP 	7.2.10-0ubuntu0.18.04.1 (apache2handler)
MySQL 	5.7.24-0ubuntu0.18.04.1-log

We are used to place a template at the bottom of a page, to change the sort order. We place all categories at the end of the page and put the template after the last category. If there is a blank line between category and template, then the result is an unaesthetic space before the category. See here: https://test.perrypedia.proc.org/wiki/Example1

No problem. So we remove the blank line and everything's fine: https://test.perrypedia.proc.org/wiki/Example2

If we do the same with a redirect, it doesn't work: https://test.perrypedia.proc.org/mediawiki/index.php?title=Example3&redirect=no

So we need to remove the newline between category and template: https://test.perrypedia.proc.org/mediawiki/index.php?title=Example4&redirect=no

This is of course a minor issue. At least it is odd that the "space before category"-behaviour depends on whether it is a redirect or not?

Ciencia Al Poder (talkcontribs)

Categories and interlanguage links produce no output. However, having a line with only category links renders as an empty line, which usually means it's a new paragraph. MediaWiki automatically trims empty text at the end of the page, and this works perfectly when categories are at the end of the page, but not if there's a template below the categories, because it produces output that's not trimmed. The defaultsort parser function works wherever you put it on the page, so ideally you should always leave your categories at the end.

Alzi24 (talkcontribs)

We do so now and it works fine, thanks.

Hsch31 (talkcontribs)

wieso glaubt mir mbf einfach nicht, dass ich meine Standardmodell-Konstruktionen alle alleine gemacht habe und unterstellt mir "unbekannte Herkunft" ohne Lizenzberechtigung ? Ob 3 oder 4 ist mir doch egal. Es ist doch nicht mein Fehler, wenn ein CERN Baukasten mit 17 Quadraten und allen Angaben mit Spin & Ladung von den Forschern nicht nach Gell-Mann's Angaben mit der nötigen STRANGENESS (mit den kleinen x/3 Brüchen, die nämlich 1960 in der Literatur veröffentlicht wurden (Labor & Chemie) erweitert wurde, sondern auf der 18 Konstanten benötigten Lagrange-Formel sitzen geblieben wurde. Ich habe schliesslich nur in meiner Pensionierung die neuen Medien am PC angewandt.

Ich warte eigentlich schon seit 2 Jahren, bis mir einer einen Konstruktionsfehler nachweist, der mit der Mathematik und experimentell nicht übereinstimmt. Auch wenn meine notgedrungene Publikation nicht von Gell-Mann gepeert wurde, kann sie dennoch nicht ganz falsch im jetzigen Zeitpunkt sein.

2001:16B8:10B9:5700:2933:4D21:24AD:F693 (talkcontribs)

Vermutlich betrifft dieser inhaltliche Änderungswunsch de:Standardmodell. Grundsätzlich gilt, dass Angaben in Artikeln durch reputable Quellen belegt sein müssen, siehe de:WP:Q. Wenn es solche Quellengibt, können die Angaben in Artikel eingebaut werden. Gibt es sie nicht, dann ist das nicht möglich. Das zu besprechen ist hier allerdings der falsche Ort. Der richtige Ort ist die Diskussionsseite des Artiels bzw. des anderen beteiligten Benutzers (dessen Name offenbar Mfb und nicht Mbf ist).

Reply to "Ursprungszertifikat für Hsch31"

Extension:Graph yields a blank canvas

7
Siacali (talkcontribs)

Fresh install with 1.32 with latest JsonConfig, and Graph. Without parsoid, Graph yields an empty blank space where the graph should appear (tested using various sample Vega graphs), With parsoid, Graph yields a broken image icon. No errors appear in logs with logging turned on both on Mediawiki and php. I'm not sure how to debug this? Any clues?

Bawolff (talkcontribs)

Not very familar with Graph extension, but my first debugging suggestion would be to look at the javasscript console in your web browser to check for JS errors.

Siacali (talkcontribs)

Makes sense, but nothing very informative appears there...there are a bunch of minor javascript errors (certain attributes not available, etc), but nothing catastrophic and they change when I insert different graphs.

No graphs (that I've tried so far) produce any real output other than the blank space...as I've used sources from graphs that appear to be working on this site, my expectation is that they should work on my own.

Bawolff (talkcontribs)

Minor JS errors are probably enough (depending on what they actually are) to stop javascript execution and prevent the graph from showing up.

Siacali (talkcontribs)

makes sense, but that gives no indication of what I should seek to fix or why the generated javascript would be wrong. All of the javascript is coming from underlying mediawiki or plugin code...not sure what I could "fix" in Javascript...

Ciencia Al Poder (talkcontribs)

Open a bug report to the maintainer of the extension, if you think it's a bug and not related to your personal/site JavaScript

Siacali (talkcontribs)

not sure if it's a bug or a configuration error...completely vanilla site, so it's not our javascript....

Reply to "Extension:Graph yields a blank canvas"

apierror-visualeditor-docserver-http-error: (curl error: 7) Couldn't connect to server

3
77.45.72.171 (talkcontribs)
Malyacko (talkcontribs)

Those versions (1.23) are ancient, unsupported, and insecure nowadays. Why did you choose these version instead of installing recent supported software?

Spcnk (talkcontribs)
Reply to "apierror-visualeditor-docserver-http-error: (curl error: 7) Couldn't connect to server"