Project:Support desk

Jump to navigation Jump to search

About this board

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

There are also other places where to ask :

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".
Previous page history was archived for backup purposes at Project:Support_desk/old on 2015-07-30.
Other languages: English  العربية čeština Esperanto français 日本語 中文
Ellif (talkcontribs)

My Help:ChangeContentModel falils to make css as 'sanitized css'. Can you help me?


[Xiqd@GSXT06h-9JkPcQZ6QAAAAE] /wiki/%ED%8A%B9%EC%88%98:%EC%BD%98%ED%85%90%EC%B8%A0%EB%AA%A8%EB%8D%B8%EB%B0%94%EA%BE%B8%EA%B8%B0 Error from line 78 of /home2/ellifgkr/wiki/extensions/TemplateStyles/includes/TemplateStylesContent.php: Class 'Wikimedia\CSS\Parser\Parser' not found Backtrace:

  1. 0 /home2/ellifgkr/wiki/extensions/TemplateStyles/includes/TemplateStylesContent.php(135): TemplateStylesContent->sanitize(array)
  2. 1 /home2/ellifgkr/wiki/includes/Revision/RenderedRevision.php(267): TemplateStylesContent->getParserOutput(Title, NULL, ParserOptions, boolean)
  3. 2 /home2/ellifgkr/wiki/includes/Revision/RenderedRevision.php(236): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(TemplateStylesContent, boolean)
  4. 3 /home2/ellifgkr/wiki/includes/Revision/RevisionRenderer.php(215): MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string)
  5. 4 /home2/ellifgkr/wiki/includes/Revision/RevisionRenderer.php(152): MediaWiki\Revision\RevisionRenderer->combineSlotOutput(MediaWiki\Revision\RenderedRevision, array)
  6. 5 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}(MediaWiki\Revision\RenderedRevision, array)
  7. 6 /home2/ellifgkr/wiki/includes/Revision/RenderedRevision.php(198): call_user_func(Closure, MediaWiki\Revision\RenderedRevision, array)
  8. 7 /home2/ellifgkr/wiki/includes/Storage/DerivedPageDataUpdater.php(1290): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
  9. 8 [internal function]: MediaWiki\Storage\DerivedPageDataUpdater->getCanonicalParserOutput()
  10. 9 /home2/ellifgkr/wiki/includes/edit/PreparedEdit.php(104): call_user_func(array)
  11. 10 /home2/ellifgkr/wiki/includes/edit/PreparedEdit.php(119): MediaWiki\Edit\PreparedEdit->getOutput()
  12. 11 /home2/ellifgkr/wiki/includes/Storage/DerivedPageDataUpdater.php(1268): MediaWiki\Edit\PreparedEdit->__get(string)
  13. 12 /home2/ellifgkr/wiki/includes/page/WikiPage.php(2030): MediaWiki\Storage\DerivedPageDataUpdater->getPreparedEdit()
  14. 13 /home2/ellifgkr/wiki/extensions/SpamBlacklist/includes/SpamBlacklistHooks.php(30): WikiPage->prepareContentForEdit(TemplateStylesContent)
  15. 14 /home2/ellifgkr/wiki/includes/Hooks.php(174): SpamBlacklistHooks::filterMergedContent(DerivativeContext, TemplateStylesContent, Status, string, User, boolean)
  16. 15 /home2/ellifgkr/wiki/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
  17. 16 /home2/ellifgkr/wiki/includes/specials/SpecialChangeContentModel.php(260): Hooks::run(string, array)
  18. 17 /home2/ellifgkr/wiki/includes/htmlform/HTMLForm.php(690): SpecialChangeContentModel->onSubmit(array, OOUIHTMLForm)
  19. 18 /home2/ellifgkr/wiki/includes/htmlform/HTMLForm.php(582): HTMLForm->trySubmit()
  20. 19 /home2/ellifgkr/wiki/includes/htmlform/HTMLForm.php(597): HTMLForm->tryAuthorizedSubmit()
  21. 20 /home2/ellifgkr/wiki/includes/specialpage/FormSpecialPage.php(185): HTMLForm->show()
  22. 21 /home2/ellifgkr/wiki/includes/specialpage/SpecialPage.php(575): FormSpecialPage->execute(NULL)
  23. 22 /home2/ellifgkr/wiki/includes/specialpage/SpecialPageFactory.php(611): SpecialPage->run(NULL)
  24. 23 /home2/ellifgkr/wiki/includes/MediaWiki.php(296): MediaWiki\Special\SpecialPageFactory->executePath(Title, RequestContext)
  25. 24 /home2/ellifgkr/wiki/includes/MediaWiki.php(900): MediaWiki->performRequest()
  26. 25 /home2/ellifgkr/wiki/includes/MediaWiki.php(527): MediaWiki->main()
  27. 26 /home2/ellifgkr/wiki/index.php(44): MediaWiki->run()
  28. 27 {main}
Reply to "My wiki fails for changing"

Language of 'contents' in ToC changes randomly on its own

2
Star Warden (talkcontribs)

Hey. We have the following issue on our wiki where the word 'Contents' in the table of contents translates itself automatically and randomly to a random language. Here are some examples:

What could be the cause behind this? It doesn't matter if I am logged in or not, nor the language chosen for the wiki's interface.

Bawolff (talkcontribs)

generally this sounds like language parser cache pollution. It can be caused if an extension is using the wrong language object (e.g. not the one for the current page)

That said, i havent looked in detail

Reply to "Language of 'contents' in ToC changes randomly on its own"

How to pull the number of daily edits on wikipedia?

2
199.20.44.50 (talkcontribs)

I want to pull the number of daily edits on Wikipedia, going back a year. Is there a way to do that with the API?

Bawolff (talkcontribs)

possibly, but it would be easier via quarry.wmflabs.org (you can use the revision table)

Reply to "How to pull the number of daily edits on wikipedia?"

Problems with composer in a new (clean) install of MW 1.34 (or 1.33)

4
Mgreis (talkcontribs)

I'm looking for some help with Composer on a new (clean) install of Mediawiki and SMW.

As background, I've been using SMW for 5+ years. Like many - I suspect - my use of Composer is pretty much limited to what's needed to install and maintain SMW. My installation is at MW 1.28 and SMW 3.0.1. There was a pretty significant problem with MW 1.30+, PHP 7 and Sphinx Search, so I haven't been able to consider upgrading in some time. At this point, the challenges of going from MW 1.28 -> 1.34 and PHP 5.6 to PHP 7.2 have made upgrading my current wiki a dubious proposition.

Instead, I am creating a new MW 1.34 wiki on a new server, installing my extensions and planning to export my pages from the current wiki and import them into the new wiki. That's the plan, anyway....

When I install MW 1.34 (on a cPanel-based server, so cPanel does the installation), there is no composer.json file in the root directory of the wiki. I can't put SMW in a composer.local.json file and have it recognized.

I can create a minimal composer.json with one or two extensions. However, when the update script is later run and I'm prompted to run composer to create a lock file, a whole bunch of libraries required by MW are removed. It took me the better part of a day to realize what was happening (since the first symptom was a HTTP 500 error). My research uncovered some of the syntax required in composer.json to look for the composer.local.json file and to look for other composer.json files in the MW directory structure, but it's not clear what I need to have in composer.json to ensure that everything MW needs to run is accounted for along with SMW.

I looked back at my current MW 1.28 implementation, and the composer.json file has a lot of statements that were clearly provided by MW, along with my additions for SMW. Somewhere between my first implementation and this, that seems to have changed.


I've been trying to forensically recreate a composer.json that would at least not blow away my MW but that is proving difficult and doesn't make a lot of sense to me.  Why should I re-create a file that MW absolutely must have to operate once composer is used? I may be missing something, but I'm at a loss to understand what.


Any help would be appreciated!

Bawolff (talkcontribs)

honestly,my main advice would be to not use cpanel to install mediawiki but use the official tarball.

Mgreis (talkcontribs)

That's the next step I'm trying.

But can you or anyone tell me, am I correct that there should be a composer.json in the base directory after I've unzipped and installed it? That's the rub. If I can use composer to install SMW and my other extensions without destroying the installation, I should be good to go.

And if not, how do I get/create a composer.json to install extensions without wrecking the installation?


Thanks, @Bawolff

Bawolff (talkcontribs)

afaik the tarball should have a composer.json. mw core dependencies are preinstalled but its there just in case. I think. I havent looked at the tarball recently.


The whole installing extensions via composer isnt really officially reccomended but the smw people seem very insistent on it :S

Reply to "Problems with composer in a new (clean) install of MW 1.34 (or 1.33)"

Readapidenied after clientlogin status PASS on private wiki

6
ErikWG (talkcontribs)

Hi!

I successfully managed to use the clientlogin api to login and get a status of "PASS". The http library I use correctly handles cookies and headers.

However, when I do either of the following requests after having received the PASS on clientlogin:


...api.php?action=parse&page=lol&format=json

or

...?action=query&assert=user&format=json


I get a readapidenied error.

I only get this error when I'm trying to GET from my code. If I open a browser and login manually and then type the queries manually as well, I get a correct response. Any ideas as to why this is?

Ciencia Al Poder (talkcontribs)

This clearly indicates the http library you're using doesn't handle cookies well, or you're not telling that library to handle them.

ErikWG (talkcontribs)

Well, the thing is that I can GET logintoken and use it and the set cookies/headers to login with a successful PASS, but I still get the readapidenied when I try to do any other api calls.

The wiki in question is https://fwiki.se/ with api located at https://fwiki.se/api.php


Ciencia Al Poder (talkcontribs)

You'll have to debug the client library you use to make it print all headers, and see if it actually sends the cookies it receives from the login.

The api works fine since you said from your browser being logged in you don't get the error.

200.56.63.155 (talkcontribs)

@ErikWG how do you fixed the error readapidenied.

89.253.82.151 (talkcontribs)

I simply used a different HTTP package for better management of cookies. Cookie and header-handling turned out to be my problem.

Reply to "Readapidenied after clientlogin status PASS on private wiki"

Shared Host Mediawiki install v1.23.9: Editing Common:CSS has no effect.

3
KarlDrive (talkcontribs)

I have a wiki on a shared hosting server that was auto installed via cpanel, it's an older version of media wiki version 1.23.9. I wish I had known that to start off with, I assumed they were using the latest version, would have saved me some headaches when trying to install extensions.

In any case I've been making due because it does everything I want it to do for the most part and I'm not experience enough to try to manually update it.

The only thing I do wish to change are colors (would like a dark theme) however when I attempt to do so by editing the common:css and reloading the page with shift+f5 I see no effect. I took a look at my wiki in edge and also saw no effect.

I've been goggling this problem for the last two weeks I think I just lack some fundamental knowledge that's causing me to over look the root issue. I've tried copping tutorial changes onto the page and no effect, I've delete the vector.css and common.css pages and tried again and no effect.

I've reduced my css to the simplest of changes in order to eliminate variables. An example of what I've trying now is bellow.

body {background-color: #000000;}

I may just be entering entirely the wrong code, I've tried adding the !important tag after reading some things about css priority and no change.

The only other things I've changed about my wiki is that I've added tinyMCE and tried to add some 1.31 extensions before I realized that I was on 1.23.9. Maybe some of the poking around I did broke the common.css function? I'm not sure. I deleted all of the old

I also tried disabling tinyMCE and running the above code without it enabled in localsettings.php but still no effect.

Any how, this is a long shot but if any one has any insight that would be amazing. Thank you!

-Karl

Bawolff (talkcontribs)

the page you need to edit to adjust css is named MediaWiki:Common.css not common:css

KarlDrive (talkcontribs)

Yeah that worked *sucks air through teeth and sighs* god damn it, I knew it was some thing obvious. Thank you so much man!

Reply to "Shared Host Mediawiki install v1.23.9: Editing Common:CSS has no effect."
Zeeebear (talkcontribs)

I just downloaded the App., don't remember my password, as I auto login on my Browser. When I try to say that I FORGOT MY PASSWORD for the App., it bring's me to another screen, that say's due to protocol it won't let me do that function. I keep trying. It's very frustrating...

Reply to "Wikipedia App., can't login."

Error in the sequence of orders: the "label" function does not exist.

5
Summary by Jomagalo

Solved thanks to @Ammarpad. The problem was a confusion of templates in the language

Jomagalo (talkcontribs)

The Label template throws me an error saying that the "label" function does not exist. How can i fix this?

MW version 1.34.0

Thank you

Malyacko (talkcontribs)

@Jomagalo Please explain what "the Label template" is and provide clear steps to reproduce that leave no room for interpretation.

Jomagalo (talkcontribs)
Ammarpad (talkcontribs)

After importing the module from English Wikipedia, you made this edit where you attempted translating it to Spanish. That's where your problem originated. You renamed (among others) the 'label' function to 'enlace' and then in the Template you invoked the now non-existent 'label' function. You have to invoke 'enlace' now, and for all other functions you changed, you've to invoke only the new name too and forget the older English ones.

Jomagalo (talkcontribs)

@Ammarpad Thank you very much, I have been able to solve it with your help.

upgraded to Mediawiki 1.34 exception error

6
Liquifusiondoug (talkcontribs)

I upgraded to Mediawiki 1.34 and everything seemed to work fine but when I try to run the site now I'm getting the following error:


Notice: "" is not a valid magic word for "ev" [Called from Language::getMagic in /home/ftri_org/support.ftri.org/languages/Language.php at line 3114] in /home/ftri_org/support.ftri.org/includes/debug/MWDebug.php on line 333

[XiICa3Q8eI2r65h95k8xPAAAAAc] /index.php?title=FTRI_Support_Home MWException from line 183 of /home/ftri_org/support.ftri.org/includes/MagicWord.php: Error: invalid magic word 'ev'

Backtrace:

#0 /home/ftri_org/support.ftri.org/includes/MagicWordFactory.php(222): MagicWord->load(string)

#1 /home/ftri_org/support.ftri.org/includes/parser/Parser.php(5288): MagicWordFactory->get(string)

#2 /home/ftri_org/support.ftri.org/includes/StubObject.php(112): Parser->setFunctionHook(string, string)

#3 /home/ftri_org/support.ftri.org/includes/StubObject.php(138): StubObject->_call(string, array)

#4 /home/ftri_org/support.ftri.org/extensions/EmbedVideo/EmbedVideo.hooks.php(24): StubObject->__call(string, array)

#5 /home/ftri_org/support.ftri.org/extensions/EmbedVideo/EmbedVideo.hooks.php(17): EmbedVideo::addMagicWord(string, string, string)

#6 /home/ftri_org/support.ftri.org/includes/Hooks.php(174): EmbedVideo::setup(Parser)

#7 /home/ftri_org/support.ftri.org/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)

#8 /home/ftri_org/support.ftri.org/includes/parser/Parser.php(476): Hooks::run(string, array)

#9 /home/ftri_org/support.ftri.org/includes/cache/MessageCache.php(1189): Parser->firstCallInit()

#10 /home/ftri_org/support.ftri.org/includes/cache/MessageCache.php(1165): MessageCache->getParser()

#11 /home/ftri_org/support.ftri.org/includes/language/Message.php(1280): MessageCache->transform(string, boolean, LanguageEn, Title)

#12 /home/ftri_org/support.ftri.org/includes/language/Message.php(884): Message->transformText(string)

#13 /home/ftri_org/support.ftri.org/includes/language/Message.php(944): Message->toString(string)

#14 /home/ftri_org/support.ftri.org/includes/OutputPage.php(888): Message->text()

#15 /home/ftri_org/support.ftri.org/includes/OutputPage.php(937): OutputPage->setHTMLTitle(Message)

#16 /home/ftri_org/support.ftri.org/includes/page/Article.php(638): OutputPage->setPageTitle(string)

#17 /home/ftri_org/support.ftri.org/includes/actions/ViewAction.php(63): Article->view()

#18 /home/ftri_org/support.ftri.org/includes/MediaWiki.php(511): ViewAction->show()

#19 /home/ftri_org/support.ftri.org/includes/MediaWiki.php(302): MediaWiki->performAction(Article, Title)

#20 /home/ftri_org/support.ftri.org/includes/MediaWiki.php(900): MediaWiki->performRequest()

#21 /home/ftri_org/support.ftri.org/includes/MediaWiki.php(527): MediaWiki->main()

#22 /home/ftri_org/support.ftri.org/index.php(44): MediaWiki->run()

#23 {main}


Thanks!

Malyacko (talkcontribs)
Bawolff (talkcontribs)

sounds like something wrong with how embed video is registering magic words. Try removing it from localsettings.php, browse to a couple pages, and re-add it. If that doesnt fix it, i think its likely a bug in the extension.

Liquifusiondoug (talkcontribs)

I removed the embed video extension and I was then able to move forward with the upgrade. However, when I got to the "Upgrade existing installation" step and it tried to upgrade the database (of our existing mediawiki) I got the following error (any suggestions?):

There was an error while upgrading the MediaWiki tables in your database. For more information look into the log above, to retry click Continue.

The end of the log had this error:

Dropping usertext_timestamp index from table archive ...done.

Table logging contains log_user field. Dropping ...

An error occurred:

A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?

Query: ALTER TABLE `image`

DROP INDEX img_user_timestamp,

DROP INDEX img_usertext_timestamp,

DROP COLUMN img_user,

DROP COLUMN img_user_text,

ALTER COLUMN img_actor DROP DEFAULT

Function: Wikimedia\Rdbms\Database::sourceFile( /home/ftri_org/support.ftri.org/maintenance/archives/patch-drop-user-fields.sql )

Error: 1091 Can't DROP 'img_user_timestamp'; check that column/key exists (mysql.ftri.org)

Liquifusiondoug (talkcontribs)

I tried to continue in the process and I'm still getting database errors:

An error occurred:

A database query error has occurred. Did you forget to run your application's database schema updater after upgrading?

Query: ALTER TABLE `archive`

DROP COLUMN ar_user,

DROP COLUMN ar_user_text,

ALTER COLUMN ar_actor DROP DEFAULT

Function: Wikimedia\Rdbms\Database::sourceFile( /home/ftri_org/support.ftri.org/maintenance/archives/patch-drop-user-fields.sql )

Error: 1091 Can't DROP 'ar_user'; check that column/key exists (mysql.ftri.org)

Ciencia Al Poder (talkcontribs)

Try to execute those statements directly on the database, and run the update.php script again

Reply to "upgraded to Mediawiki 1.34 exception error"

Sorry! This site is experiencing technical difficulties.

9
Kianlolcat99 (talkcontribs)

Hello, My wiki is not on the internet, rather I am editing it locally. It worked perfectly. I moved my wiki from one computer to another. Now when I open it, it says the following message- "Sorry! This site is experiencing technical difficulties.

Try waiting a few minutes and reloading.

(Cannot access the database)"

I am using XXAMP (on both computers), and both computers are windows. Can someone help me? Thanks, Kianlolcat99.

Edit: This is Mediawiki 1.26

83.135.239.136 (talkcontribs)

In LocalSettings.php you have the database credentials, which MediaWiki is using to connect to the database. On the new server these credentials obviously are different from the old one.

Make sure that database name, MySQL username, password and host are correct!

Reception123 (talkcontribs)

It could be a problem with the ports. Be sure to check those and check that you haven't changed the MySQL username or password.

Kianlolcat99 (talkcontribs)

Ok I will check them then. When I do both of the things you suggested, I will report what happened.

Kianlolcat99 (talkcontribs)

83.135.239.136, do I have to update my media wiki version?

83.135.232.71 (talkcontribs)

No, to get this problem solved you don't have to update MediaWiki. All you have to do is adjust the database variables in LocalSettings.php. Then MW 1.26 will work again.

However, when you are looking at Version lifecycle you will notice that MW 1.26 no longer is supported. So you in fact should upgrade - in order to keep your system safe.

Kianlolcat99 (talkcontribs)

What database variables do I have to adjust?

Ciencia Al Poder (talkcontribs)
Kianlolcat99 (talkcontribs)