Page MenuHomePhabricator

PHP Notice: Undefined index: edit (CologneBlueHooks.php)
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error message
[X-8w1wpAAEUAACjBV1AAAACP] /wiki/Special:NewFiles   ErrorException from line 147 of /srv/mediawiki/php-1.36.0-wmf.26/skins/CologneBlue/includes/CologneBlueHooks.php: PHP Notice: Undefined index: edit

/srv/mediawiki/php-1.36.0-wmf.26/skins/CologneBlue/includes/CologneBlueHooks.php:147
Stack Trace
#0 /srv/mediawiki/php-1.36.0-wmf.26/skins/CologneBlue/includes/CologneBlueHooks.php(147): MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /srv/mediawiki/php-1.36.0-wmf.26/includes/HookContainer/HookContainer.php(333): CologneBlueHooks::onSkinTemplateNavigationUniversal(SkinCologneBlue, array)
#2 /srv/mediawiki/php-1.36.0-wmf.26/includes/HookContainer/HookContainer.php(140): MediaWiki\HookContainer\HookContainer->callLegacyHook(string, array, array, array)
#3 /srv/mediawiki/php-1.36.0-wmf.26/includes/HookContainer/HookRunner.php(3590): MediaWiki\HookContainer\HookContainer->run(string, array, array)
#4 /srv/mediawiki/php-1.36.0-wmf.26/includes/skins/SkinTemplate.php(1130): MediaWiki\HookContainer\HookRunner->onSkinTemplateNavigation__Universal(SkinCologneBlue, array)
#5 /srv/mediawiki/php-1.36.0-wmf.26/includes/skins/SkinMustache.php(198): SkinTemplate->buildContentNavigationUrls()
#6 /srv/mediawiki/php-1.36.0-wmf.26/includes/skins/SkinMustache.php(190): SkinMustache->getPortletsTemplateData()
#7 /srv/mediawiki/php-1.36.0-wmf.26/skins/CologneBlue/includes/SkinCologneBlue.php(60): SkinMustache->getTemplateData()
#8 /srv/mediawiki/php-1.36.0-wmf.26/includes/skins/SkinMustache.php(128): SkinCologneBlue->getTemplateData()
#9 /srv/mediawiki/php-1.36.0-wmf.26/includes/skins/SkinTemplate.php(146): SkinMustache->generateHTML()
#10 /srv/mediawiki/php-1.36.0-wmf.26/includes/OutputPage.php(2626): SkinTemplate->outputPage()
#11 /srv/mediawiki/php-1.36.0-wmf.26/includes/MediaWiki.php(951): OutputPage->output(boolean)
#12 /srv/mediawiki/php-1.36.0-wmf.26/includes/MediaWiki.php(964): MediaWiki->{closure}()
#13 /srv/mediawiki/php-1.36.0-wmf.26/includes/MediaWiki.php(548): MediaWiki->main()
#14 /srv/mediawiki/php-1.36.0-wmf.26/index.php(53): MediaWiki->run()
#15 /srv/mediawiki/php-1.36.0-wmf.26/index.php(46): wfIndexMain()
#16 /srv/mediawiki/w/index.php(3): require(string)
#17 {main}
Impact
  1. Notes

Event Timeline

Krinkle renamed this task from PHP Notice: Undefined index: edit to PHP Notice: Undefined index: edit (CologneBlueHooks.php).Jan 13 2021, 7:54 PM
Krinkle added subscribers: Jdlrobson, Krinkle.

Change 655971 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/skins/CologneBlue@master] Edit link may not be present, avoid undefined index notice

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

Change 655971 merged by jenkins-bot:
[mediawiki/skins/CologneBlue@master] Edit link may not be present, avoid undefined index notice

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

This causes a visual bug in the interface too – there's a non-functional "Edit this page" text in the sidebar on special pages, e.g. https://en.wikipedia.beta.wmflabs.org/wiki/Special:NewFiles?useskin=cologneblue.

image.png (2×3 px, 1 MB)

It should disappear when the patch is deployed.

Change 655932 had a related patch set uploaded (by Krinkle; owner: Jdlrobson):
[mediawiki/skins/CologneBlue@wmf/1.36.0-wmf.26] Edit link may not be present, avoid undefined index notice

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

These changes haven't been pushed to production, have they?

<rant>I am surprised we still maintain CologneBlue, at one point for sure we would have to phase it out entirely.</rant>

Regardless, in agreement with Lars, I am handling the deployment of this. Given the fix is straightforward and there is an easy way to validate the fix, I feel confident deploying/verifying it by myself.

Change 655932 merged by jenkins-bot:
[mediawiki/skins/CologneBlue@wmf/1.36.0-wmf.26] Edit link may not be present, avoid undefined index notice

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

Mentioned in SAL (#wikimedia-operations) [2021-01-14T14:06:04Z] <hashar@deploy1001> Synchronized php-1.36.0-wmf.26/skins/CologneBlue/includes/CologneBlueHooks.php: Edit link may not be present, avoid undefined index notice T271978 (duration: 01m 07s)

This causes a visual bug in the interface too – there's a non-functional "Edit this page" text in the sidebar on special pages, e.g. https://en.wikipedia.beta.wmflabs.org/wiki/Special:NewFiles?useskin=cologneblue.

image.png (2×3 px, 1 MB)

It should disappear when the patch is deployed.

I could not reproduce that on production targeting en.wikipedia.org either before or after applying the patch. It is a mystery to me.

I have deployed the change everywhere. Should be good now.

And trying again on https://en.wikipedia.org/wiki/Special:NewFiles?useskin=cologneblue , there is indeed an Edit this page link in the toolbar with the tooltip stating: This is a special page which you cannot edit.

edit special page.png (263×165 px, 16 KB)

I guess Special:NewFiles output or the toolbar is cached somehow and when I tried via mwdebug it was serving the cached page regardless of the CologneBlue patch. Bah.

Reopen for the glitch.

Should this be UBN as train blocking?

No. It's cologne blue so no ubn.

I can take a look at the glitch. I've been trying to simplify the code in that repo.

Note: we don't show Cologne Blue in preferences and are slowly in the phase of phasing it out https://en.wikipedia.org/wiki/Special:Preferences#mw-prefsection-rendering so CologneBlue bugs should only block deploys if they throw production errors.

Change 656235 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/skins/CologneBlue@master] Hide empty portlets

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

I'm closing this as the new issue reported has nothing to do with this one. See T272064

Change 656235 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/skins/CologneBlue@master] Hide empty portlets and apply standard portlet classes to portlets

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

Change 656235 merged by jenkins-bot:
[mediawiki/skins/CologneBlue@master] Hide empty portlets and apply standard portlet classes to portlets

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