Extension talk:GetUserName/Archive 1
Breaks on MediaWiki 1.33
editThis extension caused failure on our Wiki after updating to MediaWiki 1.33.0. The Backtrace is (after accessing any page):
[d46631b531eb32a243afc181] /wiki/index.php/Hauptseite MWException from line 187 of /usr/share/webapps/mediawiki/includes/MagicWord.php: Error: invalid magic word 'USERNAME'
Backtrace:
- 0 /usr/share/webapps/mediawiki/includes/MagicWordFactory.php(222): MagicWord->load(string)
- 1 /usr/share/webapps/mediawiki/includes/parser/Parser.php(4958): MagicWordFactory->get(string)
- 2 /usr/share/webapps/mediawiki/extensions/GetUserName/GetUserName.php(27): Parser->setFunctionHook(string, array, integer)
- 3 /usr/share/webapps/mediawiki/includes/Hooks.php(174): ExtGetUserName::setup(Parser)
- 4 /usr/share/webapps/mediawiki/includes/Hooks.php(202): Hooks::callHook(string, array, array, NULL)
- 5 /usr/share/webapps/mediawiki/includes/parser/Parser.php(384): Hooks::run(string, array)
- 6 /usr/share/webapps/mediawiki/includes/StubObject.php(112): Parser->firstCallInit()
- 7 /usr/share/webapps/mediawiki/includes/StubObject.php(138): StubObject->_call(string, array)
- 8 /usr/share/webapps/mediawiki/includes/cache/MessageCache.php(1210): StubObject->__call(string, array)
- 9 /usr/share/webapps/mediawiki/includes/cache/MessageCache.php(1186): MessageCache->getParser()
- 10 /usr/share/webapps/mediawiki/includes/Message.php(1291): MessageCache->transform(string, boolean, Language, Title)
- 11 /usr/share/webapps/mediawiki/includes/Message.php(895): Message->transformText(string)
- 12 /usr/share/webapps/mediawiki/includes/Message.php(955): Message->toString(string)
- 13 /usr/share/webapps/mediawiki/includes/OutputPage.php(902): Message->text()
- 14 /usr/share/webapps/mediawiki/includes/OutputPage.php(951): OutputPage->setHTMLTitle(Message)
- 15 /usr/share/webapps/mediawiki/includes/page/Article.php(621): OutputPage->setPageTitle(string)
- 16 /usr/share/webapps/mediawiki/includes/actions/ViewAction.php(68): Article->view()
- 17 /usr/share/webapps/mediawiki/includes/MediaWiki.php(499): ViewAction->show()
- 18 /usr/share/webapps/mediawiki/includes/MediaWiki.php(294): MediaWiki->performAction(Article, Title)
- 19 /usr/share/webapps/mediawiki/includes/MediaWiki.php(865): MediaWiki->performRequest()
- 20 /usr/share/webapps/mediawiki/includes/MediaWiki.php(515): MediaWiki->main()
- 21 /usr/share/webapps/mediawiki/index.php(42): MediaWiki->run()
- 22 {main}
We started using the MyVariables extension instead, which works fine.
- Thanks for the note. I archived this extension. --[[kgh]] (talk) 07:58, 17 September 2019 (UTC)
- I've moved the extension to github and made it work with MediaWiki 1.33. Tinss (talk) 23:40, 5 October 2019 (UTC)
Parser cache
editThe problem with this and similar extensions is that they break the parser cache. This extension doesn't disable the parser cache, so when a page is viewed, you will get the user name of the user who caused it to be entered into the cache (e.g. by viewing it when it was not in the cache, or by editing it). You should disable the cache (see Manual:Parser functions#Caching), and on a small wiki or a short page it won't be much of a problem, but for the purpose you created this extension for, it is better to use Special:Mypage, e.g. Special:Mypage/Draft-20241222234524 (note that because of caching, currenttimestamp is the time the page was entered into the parser cache, so it may be off by several hours compared to real time.) -- Nx / talk 09:46, 22 July 2010 (UTC)
- The extension disables the cache when generating the magic word. Tinss (talk) 23:40, 5 October 2019 (UTC)