Jump to content

Extension talk:Admin Links

Add topic
From mediawiki.org
Latest comment: 1 year ago by Yaron Koren in topic 0.7 still needs to be tagged

Github: please add 0.5 tag

[edit]

https://github.com/wikimedia/mediawiki-extensions-AdminLinks/tags

Oh, I forgot to create a tag! Sorry about that - I just did it. Yaron Koren (talk) 15:27, 10 February 2022 (UTC)Reply

Feature request

[edit]

Would you consider looking at adding a LocalSettings option to add custom page links? Thank you! InnerCitadel (talk) 09:29, 28 March 2022 (UTC)Reply

This is already possible to do, although it maybe is a little trickier than it should be. If you see the example code here, all that code can be added directly to LocalSettings.php - so, within a function you define in LocalSettings.php, you can add any sections, rows or items you want. Yaron Koren (talk) 18:26, 28 March 2022 (UTC)Reply

Version 0.6 broken on MW 1.35.x and PHP 7.3

[edit]

I am getting the following notices and warnings:

Notice: Undefined index: user-menu in /../extensions/AdminLinks/includes/AdminLinks.php on line 111
Warning: array_keys() expects parameter 1 to be array, null given in /../extensions/AdminLinks/includes/AdminLinks.php on line 111
Notice: Undefined index: user-menu in /../extensions/AdminLinks/includes/AdminLinks.php on line 112
Warning: array_values() expects parameter 1 to be array, null given in /../extensions/AdminLinks/includes/AdminLinks.php on line 112
Warning: array_search() expects parameter 2 to be array, null given in /../extensions/AdminLinks/includes/AdminLinks.php on line 113
Warning: array_splice() expects parameter 1 to be array, null given in /../extensions/AdminLinks/includes/AdminLinks.php on line 114
Warning: array_splice() expects parameter 1 to be array, null given in /../extensions/AdminLinks/includes/AdminLinks.php on line 115
Warning: count(): Parameter must be an array or an object that implements Countable in /../extensions/AdminLinks/includes/AdminLinks.php on line 118

The admin link does not show. After reverting to version 0.5 of Admin Links works as expected again. [[kgh]] (talk) 22:35, 4 March 2023 (UTC)Reply

What skin are you using? Yaron Koren (talk) 03:18, 5 March 2023 (UTC)Reply
Chameleon in version 3.4.3 Hopefully moving on to 4.2.1 next week. [[kgh]] (talk) 09:38, 5 March 2023 (UTC)Reply
Thanks for letting me know about the problem - I just checked in a fix for it. Yaron Koren (talk) 20:15, 6 March 2023 (UTC)Reply
No problem. In the meantime I am on PHP 7.4. The fix only silence the error messages. The link to the AdminLinks special page, however, is not shown, both on Chameleon 3.4.3 and 4.2.1. On version 0.5 things are back to normal. [[kgh]] (talk) 13:36, 7 March 2023 (UTC)Reply
That's true. Unfortunately, I don't know how to get it working for Chameleon with the new hook (version 0.5 is using a deprecated hook). Yaron Koren (talk) 15:11, 7 March 2023 (UTC)Reply
Ah, I get it. At least you know about the issue, even if there is no solution. The fix to get rid of the warnings and notices is much better than nothing. [[kgh]] (talk) 17:42, 7 March 2023 (UTC)Reply
By the way, if you could find out from any of the Chameleon developers what the right code would be to add to this function (which is called by the SkinTemplateNavigation::Universal hook) to add in the link, that would be helpful. Yaron Koren (talk) 14:56, 9 March 2023 (UTC)Reply
Hmm, a couple of days later, when checking the link does show up. Probably some caching issue or whatever ... Anyhow, back in business on Chameleon. [[kgh]] (talk) 11:14, 11 March 2023 (UTC)Reply
That seems impossible... are you definitely using Admin Links 0.6 again? Yaron Koren (talk) 15:33, 13 March 2023 (UTC)Reply
Excuse that it took me so long to reply. Indeed, I reverted to version 0.5 - senior moments. Anyhow, the new version 0.6.1 does not show the admin link either. I will remove it for now. [[kgh]] (talk) 20:47, 16 June 2023 (UTC)Reply

Versions 0.6.x broken on MW 1.35.x and PHP 7.3 for Monobook

[edit]

I am getting the following fatal for 0.6.2 on Special:AdminLinks:

[6aac3e8a8cc818bb6bdf98d1] /ekl/Spezial:Admin-Links ParseError from line 12 of /../extensions/AdminLinks/includes/AdminLinksHookRunner.php: syntax error, unexpected 'HookContainer' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)
Backtrace
#0 [internal function]: AutoLoader::autoload(string)
#1 /../extensions/AdminLinks/includes/AdminLinks.php(78): spl_autoload_call(string)
#2 /../includes/specialpage/SpecialPage.php(600): AdminLinks->execute(NULL)
#3 /../includes/specialpage/SpecialPageFactory.php(635): SpecialPage->run(NULL)
#4 /../includes/MediaWiki.php(307): MediaWiki\SpecialPage\SpecialPageFactory->executePath(Title, RequestContext)
#5 /../includes/MediaWiki.php(947): MediaWiki->performRequest()
#6 /../includes/MediaWiki.php(547): MediaWiki->main()
#7 /../index.php(53): MediaWiki->run()
#8 /../index.php(46): wfIndexMain()
#9 {main}

Version 0.6.1 does not result into this error. Version 0.6 shows the errors already reported. The 0.6.x versions do not show the admin link at all. Thus I reverted back to version 0.5. I will update to PHP 7.4 AND 1.39 this year. Let's see what happens. --[[kgh]] (talk) 17:12, 21 October 2023 (UTC)Reply

That's odd. In your MediaWiki installation, does the file HookContainer.php look like this, with the namespace "MediaWiki\HookContainer"? Yaron Koren (talk) 13:47, 23 October 2023 (UTC)Reply
I am running MediaWiki 1.35.13 (0ef05ae). Thus I expect that the file is at this revision. [[kgh]] (talk) 16:23, 23 October 2023 (UTC)Reply
Okay, now I see the issue: the problem is not the MediaWiki version, it's the PHP version. That change in June 2023 added a typed property, which has only been supported by PHP since version 7.4, unfortunately. I just changed the PHP requirement on the extension page. Yaron Koren (talk) 17:49, 23 October 2023 (UTC)Reply
Ah, I see. Good that you were able to pin down the issue. That particular server will soon go 7.4 allowing me to upgrade Admin Links. [[kgh]] (talk) 17:52, 23 October 2023 (UTC)Reply

Hooks::run

[edit]

Hi, my MediaWiki 1.41.5 PHP 8.0

after installing and go to the AdminLinks page, it at the top of the page, I get this error on the website:

Deprecated: Use of Hooks::run was deprecated in MediaWiki 1.35. [Called from AdminLinks::execute in G:\OSPanel\domains\plant\extensions\AdminLinks\includes\AdminLinks.php at line 81] in G:\OSPanel\domains\plant\includes\debug\MWDebug.php on line 386

this is 81st line:

Hooks::run( 'AdminLinks', [ &$admin_links_tree ] );

and 386st line:

if ( $sendToLog ) {

trigger_error( $msg, E_USER_DEPRECATED );

Is there a way to fix this? Thanks! Mdyug (talk) 22:00, 31 January 2025 (UTC)Reply

My guess is that you're using an old version of Admin Links, like the REL1_41 branch. Please use the latest, i.e. master, version of the code. Yaron Koren (talk) 22:27, 31 January 2025 (UTC)Reply

0.7 still needs to be tagged

[edit]

Thanks an bunch! Cheers --[[kgh]] (talk) 09:19, 18 June 2025 (UTC)Reply

Oh, sorry, I don't know how that happened. I just created the tag. Yaron Koren (talk) 17:00, 18 June 2025 (UTC)Reply