Page MenuHomePhabricator

PHP 7.4+ notice in SkinModule::getLessVars: Trying to access array offset on value of type bool
Closed, ResolvedPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

On deployment-mwmaint02:

PHP=php7.4 mwscript extensions/WikimediaMaintenance/blameStartupRegistry.php --wiki=enwiki

What happens?:

2022-06-16 03:22:37 [f41c44897b8a7a9d1b2a8f07] deployment-mwmaint02 enwiki 1.39.0-alpha error ERROR: [f41c44897b8a7a9d1b2a8f07] [no req]   PHP Notice: Trying to access array offset on value of type bool {"exception_url":"[no req]","reqId":"f41c44897b8a7a9d1b2a8f07","caught_by":"mwe_handler"} 
[Exception ErrorException] (/srv/mediawiki/php-master/includes/ResourceLoader/SkinModule.php:705) PHP Notice: Trying to access array offset on value of type bool
  #0 /srv/mediawiki/php-master/includes/ResourceLoader/SkinModule.php(705): MWExceptionHandler::handleError(integer, string, string, integer, array)
  #1 /srv/mediawiki/php-master/includes/ResourceLoader/FileModule.php(630): MediaWiki\ResourceLoader\SkinModule->getLessVars(MediaWiki\ResourceLoader\DerivativeContext)
  #2 /srv/mediawiki/php-master/includes/ResourceLoader/SkinModule.php(715): MediaWiki\ResourceLoader\FileModule->getDefinitionSummary(MediaWiki\ResourceLoader\DerivativeContext)
  #3 /srv/mediawiki/php-master/includes/ResourceLoader/Module.php(934): MediaWiki\ResourceLoader\SkinModule->getDefinitionSummary(MediaWiki\ResourceLoader\DerivativeContext)
  #4 /srv/mediawiki/php-master/includes/ResourceLoader/ResourceLoader.php(1134): MediaWiki\ResourceLoader\Module->getVersionHash(MediaWiki\ResourceLoader\DerivativeContext)
  #5 /srv/mediawiki/php-master/extensions/WikimediaMaintenance/blameStartupRegistry.php(139): MediaWiki\ResourceLoader\ResourceLoader->makeModuleResponse(MediaWiki\ResourceLoader\DerivativeContext, array)
  #6 /srv/mediawiki/php-master/maintenance/includes/MaintenanceRunner.php(195): BlameStartupRegistry->execute()
  #7 /srv/mediawiki/php-master/maintenance/doMaintenance.php(85): MediaWiki\Maintenance\MaintenanceRunner->run()
  #8 /srv/mediawiki/php-master/extensions/WikimediaMaintenance/blameStartupRegistry.php(336): require_once(string)
  #9 /srv/mediawiki/multiversion/MWScript.php(123): require_once(string)
  #10 {main}

What should have happened instead?:

Execution without an error.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.:

3v4l confirms that false['s'] gives a notice on PHP 7.4.0+ and is silent on earlier versions. $wmgSiteLogoWordmark is set to false in InitialiseSettings-labs.php and so $logos['wordmark'] is false in getLessVars(). The documentation for $wgLogos['wordmark'] just says that it should be an array.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 805926 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/core@master] resourceloader: Don't raise notice when the logo wordmark is false

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

Change 806068 had a related patch set uploaded (by Thiemo Kreuz (WMDE); author: Thiemo Kreuz (WMDE)):

[operations/mediawiki-config@master] Fix unsupported $wgLogos default configurations

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

Change 805926 merged by jenkins-bot:

[mediawiki/core@master] resourceloader: Don't raise notice when the logo wordmark is false

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

Change 806068 merged by jenkins-bot:

[operations/mediawiki-config@master] Fix unsupported $wgLogos default configurations

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

Krinkle subscribed.

Note to self: Remove the fixme in core SkinModule.

Krinkle triaged this task as High priority.Jun 21 2022, 7:01 PM
Krinkle moved this task from Inbox to Confirmed Problem on the MediaWiki-ResourceLoader board.

Change 807204 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] resourceloader: Resolve SkinModule wordmark/tagline tech debt

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

Change 807204 merged by jenkins-bot:

[mediawiki/core@master] resourceloader: Resolve SkinModule wordmark/tagline tech debt

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