Page MenuHomePhabricator

PHP Warning: Undefined array key "href"
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
  • mwversion: 1.46.0-wmf.22
  • timestamp: 2026-04-08T17:49:33.518Z
  • phpversion: 8.3.30
  • reqId: d994e01d-8ef9-4bce-8f27-3f2f639485b7
  • Find reqId in Logstash
normalized_message
[{reqId}] {exception_url}   PHP Warning: Undefined array key "href"
FrameLocationCall
from/srv/mediawiki/php-1.46.0-wmf.22/skins/MinervaNeue/includes/Menu/User/AdvancedUserMenuBuilder.php(88)
#0/srv/mediawiki/php-1.46.0-wmf.22/skins/MinervaNeue/includes/Menu/User/AdvancedUserMenuBuilder.php(88)MediaWiki\Exception\MWExceptionHandler::handleError(int, string, string, int)
#1/srv/mediawiki/php-1.46.0-wmf.22/skins/MinervaNeue/includes/Menu/User/UserMenuDirector.php(41)MediaWiki\Minerva\Menu\User\AdvancedUserMenuBuilder->getGroup(array)
#2/srv/mediawiki/php-1.46.0-wmf.22/skins/MinervaNeue/includes/Skins/SkinMinerva.php(490)MediaWiki\Minerva\Menu\User\UserMenuDirector->renderMenuData(array)
#3/srv/mediawiki/php-1.46.0-wmf.22/skins/MinervaNeue/includes/Skins/SkinMinerva.php(309)MediaWiki\Minerva\Skins\SkinMinerva->getPersonalToolsMenu(array)
#4/srv/mediawiki/php-1.46.0-wmf.22/includes/Skin/SkinMustache.php(51)MediaWiki\Minerva\Skins\SkinMinerva->getTemplateData()
#5/srv/mediawiki/php-1.46.0-wmf.22/includes/Skin/SkinTemplate.php(172)MediaWiki\Skin\SkinMustache->generateHTML()
#6/srv/mediawiki/php-1.46.0-wmf.22/includes/Skin/Skin.php(671)MediaWiki\Skin\SkinTemplate->outputPage()
#7/srv/mediawiki/php-1.46.0-wmf.22/includes/Output/OutputPage.php(3313)MediaWiki\Skin\Skin->outputPageFinal(MediaWiki\Output\OutputPage)
#8/srv/mediawiki/php-1.46.0-wmf.22/includes/Exception/MWExceptionRenderer.php(183)MediaWiki\Output\OutputPage->output()
#9/srv/mediawiki/php-1.46.0-wmf.22/includes/Exception/MWExceptionRenderer.php(101)MediaWiki\Exception\MWExceptionRenderer::reportHTML(TypeError)
#10/srv/mediawiki/php-1.46.0-wmf.22/includes/Exception/MWExceptionHandler.php(123)MediaWiki\Exception\MWExceptionRenderer::output(TypeError, int)
#11/srv/mediawiki/php-1.46.0-wmf.22/includes/Exception/MWExceptionHandler.php(224)MediaWiki\Exception\MWExceptionHandler::report(TypeError)
#12/srv/mediawiki/php-1.46.0-wmf.22/includes/MediaWikiEntryPoint.php(200)MediaWiki\Exception\MWExceptionHandler::handleException(TypeError, string)
#13/srv/mediawiki/php-1.46.0-wmf.22/includes/Actions/ActionEntryPoint.php(81)MediaWiki\MediaWikiEntryPoint->handleTopLevelError(TypeError)
#14/srv/mediawiki/php-1.46.0-wmf.22/includes/MediaWikiEntryPoint.php(186)MediaWiki\Actions\ActionEntryPoint->handleTopLevelError(TypeError)
#15/srv/mediawiki/php-1.46.0-wmf.22/index.php(44)MediaWiki\MediaWikiEntryPoint->run()
#16/srv/mediawiki/w/index.php(3)require(string)
#17{main}
Notes

In the last 90 day window, there have been 44 hits, starting April 1, 2026.

Details

Request URL
https://id.wikipedia.org/wiki/Wikipedia:ProyekWiki_studi_LGBT/Biografi_tokoh_nonbiner,_trans_dan_interseks_yang_belum_ada/perempuan_transgender
Related Changes in Gerrit:

Event Timeline

Jdlrobson-WMF subscribed.

Minerva is likely a red herring here.

The error means something used the SkinTemplateNavigation::Universal hook to add a menu item without a href or text.
That shouldn't be allowed and should be better enforced.

The only recent change to this code was https://gerrit.wikimedia.org/r/c/mediawiki/skins/MinervaNeue/+/1264625 but I think that's likely a red herring.

We'd need to audit recent changes to SkinTemplateNavigation hooks to pinpoint the issue.

Hi, I'm following up on a comment on patch 1253392. I don’t think patch 1253392 surfaced this error, because I can’t see a way in which those changes would have removed or changed $item['href']. Let me know if you have any other questions, thanks.

Change #1270073 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/core@master] Ensure consistency across links data structure

https://gerrit.wikimedia.org/r/1270073

Thanks! I'm writing a test in core to try to debug this further!

https://gerrit.wikimedia.org/r/1270073 should help us track this down better.
I've only seen this 11 times in the last 7 days
https://logstash.wikimedia.org/goto/ca6c414a9d4b7648774495be750cee8c
context_ab_tests.we-1-8-mobile-account-menu is treatment for all the errors, so I suspect it relates to that experiment.

@Sgs perhaps you can see if you can replicate this in the experiment using https://gerrit.wikimedia.org/r/1270073 to trigger a fatal in the error state?

Theory

https://gerrit.wikimedia.org/g/mediawiki/skins/MinervaNeue/+/2ba8d3029906fa48707c3f4f6826141cf10039d5/includes/Skins/SkinMinerva.php#473 sets an icon even if the createaccount key doesn't exist

e.g.

unset( $personalUrls["createaccount"] );
....
# your code
$shouldShowAccountMenuItems = $this->shouldShowAccountMenuItems();
		if ( $shouldShowAccountMenuItems && !$hasPersonalMenu ) {
			$personalUrls["createaccount"]["icon"] = "userAvatar";
		}

Change #1270550 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/extensions/GrowthExperiments@master] Don't set href for a link that has been unset

https://gerrit.wikimedia.org/r/1270550

Change #1270550 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Don't set href for a link that has been unset

https://gerrit.wikimedia.org/r/1270550

Change #1275543 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/extensions/GrowthExperiments@wmf/1.46.0-wmf.24] Don't set href for a link that has been unset

https://gerrit.wikimedia.org/r/1275543

Michael triaged this task as High priority.Apr 28 2026, 4:02 PM
Michael moved this task from Up next Sprint to Tracking on the Growth-Team board.

I chatted about this elsewhere with @Jdlrobson-WMF, and this does not seem to need work by Growth right now. Don't set href for a link that has been unset has been merged into master and will roll out to all wikis on Thursday with the train.

But we'll keep a close look on it and are here for code review or work if it is needed from us.

Change #1275543 abandoned by Jdlrobson:

[mediawiki/extensions/GrowthExperiments@wmf/1.46.0-wmf.24] Don't set href for a link that has been unset

Reason:

I've been unable to replicate this, so not seeing the value in backporting any more. I'll monitor this as it rolls out on the train.

https://gerrit.wikimedia.org/r/1275543

Jdlrobson-WMF claimed this task.

Change #1270073 merged by jenkins-bot:

[mediawiki/core@master] Ensure consistency across links data structure

https://gerrit.wikimedia.org/r/1270073