Extension talk:GetUserName

Loizbec (talkcontribs)

Hi, I have developed for my personal needs an extension that gets the user name, but that also allows to display different content for logged in users vs anonymous users.

When I updated from MW 1.35 to MW 1.42 (!!!), I relied pretty heavily on your work to correct my extension (which is not mature enough for sharing: as far as mw is concerned I don't code, I tweak ;) ). > https://gitlab.liris.cnrs.fr/mloiseau/mw_connected

I'm not sure it is of any interest to you, but if you want to merge our work, we can.

Tinss (talkcontribs)

Salut ! Merci pour le partage !

Adding a parser function to indicate if a user is connected (anonymous or not in fact) could be useful. I suppose having a different stylesheet could be handy as well.

I could add those features ? Or maybe you can do a pull request on github ?

It however does not make sense to have this extension tweak the sidebar.

Let me know.

Loizbec (talkcontribs)

The sidebar tweak was for my needs as I added links to many namespaces for logged-in users, and I don't want external users to see them as they won't have access to the rest.

But I agree, that this should not be default behavior. It could be a parameter in the LocalSettings.php.

I've got a lot of work these days, and I still need to work out a few things. When they work, I'll do a pull request :-)

Reply to "if connected…"

Error: Call to undefined method Parser::disableCache()

2
Onandonandonandon (talkcontribs)

In MediaWiki 1.36.1 and GetUserName 2.0 I'm getting following error:

3b897e77d47c7339897b8fa] /wiki/index.php?title=PageTitle&action=submit Error: Call to undefined method Parser::disableCache()

Backtrace:

from /var/www/html/extensions/GetUserName/GetUserName.class.php(32)
#0 /var/www/html/includes/parser/Parser.php(3356): MediaWiki\Extension\GetUserName\GetUserName::magic(Parser, string)
#1 /var/www/html/includes/parser/Parser.php(3041): Parser->callParserFunction(PPFrame_Hash, string, array)
#2 /var/www/html/includes/parser/PPFrame_Hash.php(263): Parser->braceSubstitution(array, PPFrame_Hash)
#3 /var/www/html/includes/parser/Parser.php(2879): PPFrame_Hash->expand(PPNode_Hash_Tree, integer)
#4 /var/www/html/includes/parser/Parser.php(1549): Parser->replaceVariables(string)
#5 /var/www/html/includes/parser/Parser.php(639): Parser->internalParse(string)
#6 /var/www/html/includes/content/WikitextContent.php(375): Parser->parse(string, Title, ParserOptions, boolean, boolean, NULL)
#7 /var/www/html/includes/content/AbstractContent.php(591): WikitextContent->fillParserOutput(Title, NULL, ParserOptions, boolean, ParserOutput)
#8 /var/www/html/includes/EditPage.php(4238): AbstractContent->getParserOutput(Title, NULL, ParserOptions)
#9 /var/www/html/includes/EditPage.php(4143): EditPage->doPreviewParse(WikitextContent)
#10 /var/www/html/includes/EditPage.php(2920): EditPage->getPreviewText()
#11 /var/www/html/includes/EditPage.php(726): EditPage->showEditForm()
#12 /var/www/html/includes/actions/EditAction.php(71): EditPage->edit()
#13 /var/www/html/includes/actions/SubmitAction.php(38): EditAction->show()
#14 /var/www/html/includes/MediaWiki.php(531): SubmitAction->show()
#15 /var/www/html/includes/MediaWiki.php(315): MediaWiki->performAction(Article, Title)
#16 /var/www/html/includes/MediaWiki.php(913): MediaWiki->performRequest()
#17 /var/www/html/includes/MediaWiki.php(546): MediaWiki->main()
#18 /var/www/html/index.php(53): MediaWiki->run()
#19 /var/www/html/index.php(46): wfIndexMain()
#20 {main}

Is there a way to work around this?

Tinss (talkcontribs)

Hello, this should have been fixed in the latest version.

Reply to "Error: Call to undefined method Parser::disableCache()"

Warnings appear when using

2
Khavwiki (talkcontribs)

<br/>

<b>Deprecated</b>

:  Use of $wgUser was deprecated in MediaWiki 1.35. [Called from Parser::callParserFunction in /var/www/html/includes/parser/Parser.php at line 3407] in

<b>/var/www/html/includes/debug/MWDebug.php</b>

on line

<b>375</b>

<br/>

<br/>

<b>Deprecated</b>

:  $wgUser reassignment detected [Called from Parser::callParserFunction in /var/www/html/includes/parser/Parser.php at line 3407] in

<b>/var/www/html/includes/debug/MWDebug.php</b>

on line

<b>375</b>

<br/>

Tinss (talkcontribs)

Hello, this should have been fixed in the latest version.

Reply to "Warnings appear when using"
There are no older topics
Return to "GetUserName" page.