Project:Support desk

Jump to: navigation, 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, Q&A 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".
By clicking "Add topic", you agree to our Terms of Use and agree to irrevocably release your text under the CC BY-SA 3.0 License and GFDL

Controlling how blank values are displayed in a template

3
SFLord (talkcontribs)

Mediawiki Version: 1.31.0-wmf.4 (477691b)

PHP: any

Database:

A template is used in the Kabiye wiki called Ɛyaa sɔsaa which is the Kabiye Famous Persons' template. The address of the template is and the wiki address is

The signature of a famous person should only be shown if such (a signature) exists. At present, a contributor can enter a file name for a signature, but if this value is left blank, the message [[File:|190px]] is displayed which is unsatisfactory... This is the final value that is entered.

All text on the wiki is in the Kabiye language, with the exception of some French and English words, so for example the title of the Ɛyaa sɔsaa template is Modèle:Ɛyaa sɔsaa - a mixture of French & Kabiye. The Wiki went live - (came out of the incubator) about 2 months ago.

We would value any help as to how to change the template so as to only display a signature if one has been supplied. My best guess would be that some conditional statement needs to be included in the [[File: statement and have searched the existing help entries - but with no joy...

Any suggestions would be greatly valued.

I am using a Windows 7 PC and Google Chrome Version 61.0.3163.100 to update the Kabiye wikipedia.

Clump (talkcontribs)

Your use of #if is not correct. Instead of {{#if: [[File:{{{E-nesi ñɩɣʋ}}}|190px]]}}, use {{#if:{{{E-nesi ñɩɣʋ|}}}|[[File:{{{E-nesi ñɩɣʋ}}}|190px]]}}

SFLord (talkcontribs)

Clump

Thanks for your help to resolve this problem. Of course the #if conditional statement has to test for the existence of E-nesi ñɩɣʋ and then ensure that it is displayed if a value has been given.

A subsequent issue is that the Ɛyaa sɔsaa template contains 2 statements referring to the pixcel size - the first controls the image size and is the 3rd value to be added, the second is the one which is now controlled by the conditional #if statement.

We rarely, if ever, do not supply an image for a famous person, however it is frequently the case that a signature cannot be found. If an image is supplied, but no signature and the first px value is left blank, the template will by default use the px value in the final statement, but the warning:

Warning: [null Euclid] is calling Modèle:Ɛyaa sɔsaa with more than one value for the "px" parameter. Only the last value provided will be used. When previewing the page (in this case its the page to do with Euclid...) and the message:

Pages utilisant des arguments dupliqués dans les appels de modèle

is displayed, when the page is published.

The temporary resolution is to remove the first px statement from the template for those famous person pages which have no signature. I will almost certainly remove the first px statement from the Ɛyaa sɔsaa template file, but will check with the sponsor of the Kabiye wiki first.

Reply to "Controlling how blank values are displayed in a template"
Aschroet (talkcontribs)

Hi, when receiving mails from MW (e. g. when a watched page has been changed) i get only plain text mails. On installations of MW at WP, Commons, or here those mails contain clickable links. Is there an easy way to enable this feature or do i need to adapt the code for that? How is that done on WP or Commons?

Ciencia Al Poder (talkcontribs)

Try setting $wgAllowHTMLEmail, although the page says "As of MW 1.23, HTML email is not yet used by MediaWiki itself", maybe it now supports it and the page is outdated.

Aschroet (talkcontribs)

Already tried that. It did not work.

Reply to "HTML emails from mediawiki"
Evolution and evolvability (talkcontribs)

Hi! As WikiJournals expand on Wikiversity (v:WikiJMed, v:WikiJSci, v:WikiJHum), the need to format references from DOI or PMID codes is becoming more important. Is it possible to enable the Citoid extension?

TheDJ (talkcontribs)

It already is installed, as far as I understand, you just need to configure it to match the preferences of your wiki installation. Please see VisualEditor/Citation_tool and Citoid#Configure_Citoid_on_a_Citoid-enabled_wiki.

Reply to "Wikiversity Citoid"

Where can I find print.css in Skin Vector?

2
84.181.43.252 (talkcontribs)

Hi,

I use the Skin Vecrot in my MediaWiki and I want to adjust the look & feel of the print page. Where can I find the CSS to manipulate it?

Thank you very much for your feedback

TheDJ (talkcontribs)

The easiest way to adapt a stylesheet like that, is by adding stylerules to MediaWiki:Print.css of your wiki installation. These rules will then be used by all skins.

Reply to "Where can I find print.css in Skin Vector?"
Alex cmx (talkcontribs)

How can i configure the database to escape this error: 1267 Illegal mix of collations: utf8 vs cp1251?

I wanted to use cirillic symbols on the wiki.

So, when i create internal link beginnig with the letter "И" or 'и', error raises =>


[ec79bc2b15920b64df7b2aeb] /index.php?title=%D0%A1%D1%81%D1%8B%D0%BB%D0%BA%D0%B8&action=submit Wikimedia\Rdbms\DBQueryError from line 1075 of /home/htasu/hta.su/docs/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?  

Query: SELECT page_id,page_len,page_is_redirect,page_latest,page_content_model,page_namespace,page_title FROM `page` WHERE (page_namespace = '0' AND page_title = 'Интернет') 

Function: LinkHolderArray::replaceInternal

Error: 1267 Illegal mix of collations (utf8_bin,IMPLICIT) and (cp1251_general_ci,COERCIBLE) for operation '=' (htasu.mysql)

Backtrace:

#0 /home/htasu/hta.su/docs/includes/libs/rdbms/database/Database.php(933): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)

#1 /home/htasu/hta.su/docs/includes/libs/rdbms/database/Database.php(1269): Wikimedia\Rdbms\Database->query(string, string)

#2 /home/htasu/hta.su/docs/includes/parser/LinkHolderArray.php(343): Wikimedia\Rdbms\Database->select(string, array, string, string)

#3 /home/htasu/hta.su/docs/includes/parser/LinkHolderArray.php(270): LinkHolderArray->replaceInternal(string)

#4 /home/htasu/hta.su/docs/includes/parser/Parser.php(4927): LinkHolderArray->replace(string)

#5 /home/htasu/hta.su/docs/includes/parser/Parser.php(1368): Parser->replaceLinkHolders(string)

#6 /home/htasu/hta.su/docs/includes/parser/Parser.php(454): Parser->internalParseHalfParsed(string, boolean, boolean)

#7 /home/htasu/hta.su/docs/includes/content/WikitextContent.php(330): Parser->parse(string, Title, ParserOptions, boolean, boolean, NULL)

#8 /home/htasu/hta.su/docs/includes/content/AbstractContent.php(497): WikitextContent->fillParserOutput(Title, NULL, ParserOptions, boolean, ParserOutput)

#9 /home/htasu/hta.su/docs/includes/page/WikiPage.php(2071): AbstractContent->getParserOutput(Title, NULL, ParserOptions)

#10 /home/htasu/hta.su/docs/extensions/SpamBlacklist/SpamBlacklistHooks.php(37): WikiPage->prepareContentForEdit(WikitextContent)

#11 /home/htasu/hta.su/docs/includes/Hooks.php(186): SpamBlacklistHooks::filterMergedContent(RequestContext, WikitextContent, Status, string, User, boolean)

#12 /home/htasu/hta.su/docs/includes/EditPage.php(1652): Hooks::run(string, array)

#13 /home/htasu/hta.su/docs/includes/EditPage.php(2066): EditPage->runPostMergeFilters(WikitextContent, Status, User)

#14 /home/htasu/hta.su/docs/includes/EditPage.php(1493): EditPage->internalAttemptSave(NULL, boolean)

#15 /home/htasu/hta.su/docs/includes/EditPage.php(637): EditPage->attemptSave(NULL)

#16 /home/htasu/hta.su/docs/includes/actions/EditAction.php(59): EditPage->edit()

#17 /home/htasu/hta.su/docs/includes/actions/SubmitAction.php(38): EditAction->show()

#18 /home/htasu/hta.su/docs/includes/MediaWiki.php(499): SubmitAction->show()

#19 /home/htasu/hta.su/docs/includes/MediaWiki.php(293): MediaWiki->performAction(Article, Title)

#20 /home/htasu/hta.su/docs/includes/MediaWiki.php(862): MediaWiki->performRequest()

#21 /home/htasu/hta.su/docs/includes/MediaWiki.php(523): MediaWiki->main()

#22 /home/htasu/hta.su/docs/index.php(43): MediaWiki->run()

#23 {main}
MarkAHershberger (talkcontribs)

Could you give the results of "show create table page" from your database? It would also help to know your MediaWiki version, MySQL version and PHP version.

Alex cmx (talkcontribs)

php version is 5.6.6

mediawiki is 1.29.1

mySQL is mysqlnd 5.0.11

MarkAHershberger (talkcontribs)

Is this a fresh install or did you upgrade from another version? It looks like your MySQL is pretty old and should be upgraded, too.

Alex cmx (talkcontribs)

it's fresh install. I've just started experimenting in web, so i don't understand many things...

MarkAHershberger (talkcontribs)

Is this on shared hosting? Do you have access to phpMyAdmin or something similar?

Alex cmx (talkcontribs)

sorry, mysql version is 5.7.17, and yes i have access to phpMyAdmin

This comment was hidden by 2003:CC:ABCA:4500:14DA:EB6A:80B5:3D6E (history)
2003:CC:ABCA:4500:6C82:D7A8:4772:450D (talkcontribs)

Which tables and columns are using cp1251 as a collation? I think these tables and columns are problematic.

Is there only the new MediaWiki installation inside that database? Or is there also something else in it and you may be using both systems together? If it is only this new wiki, I would empty the database, then make sure the collation for new tables is utf8_general_ci and then let MediaWiki install its things into the database again.

However, I am still unsure, for why the tables had not been created with fitting collations right away. I think the installer should offer utf8 and binary only, not cp1251. utf8 and binary both are ok, but a mix with cp1251 should not be there.

This comment was hidden by Ciencia Al Poder (history)
Reply to "Configure"
Bty0808 (talkcontribs)

Users inserted into groups created by extensions, lose the privilege after logging in. Any idea of ​​what might be happening? MW1.27.

2003:CC:ABC4:B200:B04F:35F4:C93D:A079 (talkcontribs)

It is possible to revoke group rights...

But: What exactly do you mean with "they lose their privileges"? First the user is not logged in. At that point user A is member of a group, and after user A logs in, user A no longer is member of this group?

Ciencia Al Poder (talkcontribs)

Also, what extension is adding users to groups automatically?

Reply to "User groups resetting after relogin"
2601:647:4601:BF60:FD9E:CE8E:BAE9:66C8 (talkcontribs)

Black background with white text. Rather than turning on a color invert app or something, it would be nicer to have a built in option like that.

Reply to "Can we get a dark/night mode?"

Search box spins and then returns "No match was found"

4
Txantimedia (talkcontribs)

Suddenly my search box stopped working. Previously, it would return previews of all matches. Now, no matter what you type, it displays a spinning wheel and then returns "No match was found"

Thinking I would fix the problem, I went to the trouble of installing the Extension:SphinxSearch, which requires also installing and configuring Sphinx. The search now returns all sorts of stuff, but I still get the No match was found and spinning wheel, making it appear that the search isn't working.

What do I look for to resolve this problem? I'm not seeing any errors in the console.

Site: wiki.vvfh.org

OS: FreeBSD 10.3

MediaWiki 1.29.1, PHP 7.1.10, MySQL 5.6.37

MarkAHershberger (talkcontribs)

I tried searching for "vietnam" on your site and saw the spinning wheel as you mention. If you want to try and figure this out you will probably need to use the debug log. I'm afraid I don't have any ready answers, though.

Txantimedia (talkcontribs)

The Wikibase extension was causing it. I've disabled it for now, while I figure out why.

Txantimedia (talkcontribs)

I'm getting Lua module errors because wikibase is missing. I tried installing both the client and the repository, but I still get the failures in the search bar. Is there some trick to installing Wikibase so it doesn't screw up the search function?

Reply to "Search box spins and then returns "No match was found""
Korg (talkcontribs)

Hello,

Is there a way to translate a page on the fly? I know there is the Translate extension, but what I'm looking for is a solution without having to set each translatable page manually. The text to translate would be words and short phrases, not prose.

I have in mind the selectors that can be found at the top of the pages on zhwiki, hiwiki and hywiki. What is the name of these extensions/features?

Thank you in advance.

Malyacko (talkcontribs)

Do you mean Extension:ContentTranslation ?

Korg (talkcontribs)

Can the ContentTranslation extension be used to translate and directly display translated text of content pages, without any particular intervention?

I will try to be more explicit. Suppose there is the heading "References" in thousands of pages. If the user changes the display language via the Universal Language Selector, e.g. in Hungarian, the heading would be automatically translated as "Források".

There is a solution with the {{int:x}} magic word, but I would be interested in a simpler approach.

Ciencia Al Poder (talkcontribs)

The selectors at the top of such pages are because those are language variants, not different languages, and MediaWiki can perform the translation internally. See Writing systems#LanguageConverter

Korg (talkcontribs)

Thank you for the link!

Korg (talkcontribs)

Sorry, the topic is not resolved. Perhaps I have not been clear enough.

I would like to find a way to automatically translate words and short phrases in content pages.

Currently it can be done with the help of templates, the {{int:}} magic word, or a call to Wikidata, but somehow it could be cumbersome if there are thousands of pages involved, and not really easy for new users.

Perhaps this request is beyond the scope of the Support desk, and I should open a request elsewhere?

AhmadF.Cheema (talkcontribs)

Maybe you can try bulk find and replace?

For example, find all instances of "short phrase" on the Wiki and simultaneously replace all of them with something like "{{int:short phrase}}".

Korg (talkcontribs)

Thanks for the suggestion! But I think I would avoid the use of the {{int:}} magic word.

As new pages would be created, this magic word would have to be automatically added (Ok, this could be done by a bot).

Also, it seems that this magic word was intended for interface messages, so only administrators could create or update such messages (but perhaps it could be used with messages outside the MediaWiki namespace?).

Ciencia Al Poder (talkcontribs)

Install google translate on your website(wiki)? https://support.google.com/translate/answer/2534601

Reply to "Translation on the fly?"
Klaus1337 (talkcontribs)

Hello guys,

I want our IT to setup a wiki but they need to know if the mediawiki software is compatible to the existing infrastructure.

Since we could not answer every point throught by reading the tech manuals and FAQ I hope you can help me.

Is MediaWiki compatible to:

Microsoft SQL Server 2014, englisch, Databases in High Availibility Groups, no seperate instance, authentification at database level with domain accounts.

Thank you in advance!

Malyacko (talkcontribs)

See Manual:Microsoft SQL Server; Manual:Language; no idea what "High Availability Groups" are; no separate instance of what?; there is authentication for example with ActiveDirectory and with SAML-based authentication, see for example PluggableAuth.

Ciencia Al Poder (talkcontribs)

SQL Server support on MediaWiki is very poor, I suggest you to use mysql instead

Reply to "SQL-Server Compatibility"