Page MenuHomePhabricator

compact(): Undefined variable in LocalisationCache on PHP 7.3
Closed, ResolvedPublic

Description

PHP Notice:  compact(): Undefined variable: messages in /usr/share/mediawiki/includes/cache/localisation/LocalisationCache.php on line 531
PHP Notice:  compact(): Undefined variable: minimumGroupingDigits in /usr/share/mediawiki/includes/cache/localisation/LocalisationCache.php on line 531
PHP Notice:  compact(): Undefined variable: digitGroupingPattern in /usr/share/mediawiki/includes/cache/localisation/LocalisationCache.php on line 531
PHP Notice:  compact(): Undefined variable: pluralRules in /usr/share/mediawiki/includes/cache/localisation/LocalisationCache.php on line 531
PHP Notice:  compact(): Undefined variable: pluralRuleTypes in /usr/share/mediawiki/includes/cache/localisation/LocalisationCache.php on line 531
PHP Notice:  compact(): Undefined variable: compiledPluralRules in /usr/share/mediawiki/includes/cache/localisation/LocalisationCache.php on line 531

In PHP 7.3, compact now emits a notice if the variable is undefined.

This was caught by Debian's autopkgtest CI system.

Event Timeline

Legoktm added a subscriber: MaxSem.

Hmm, seems this was suppressed in ae314346d5dddf07f7dcac956db6160ceae46e8c.

Wouldn't it be cleaner to not use compact?

Change 467265 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/core@master] LocalisationCache: Avoid use of compact()

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

In any case, I'd like something to be backported to 1.31 to fix this.

Change 467265 merged by jenkins-bot:
[mediawiki/core@master] LocalisationCache: Avoid use of compact()

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

Change 467545 had a related patch set uploaded (by Legoktm; owner: Legoktm):
[mediawiki/core@REL1_31] LocalisationCache: Avoid use of compact()

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

Change 467545 merged by jenkins-bot:
[mediawiki/core@REL1_31] LocalisationCache: Avoid use of compact()

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

Krinkle assigned this task to Legoktm.
Krinkle moved this task from Backlog to Core on the MW-1.31-release board.