Page MenuHomePhabricator

PHP Deprecated: Using bool as a message parameter was deprecated in MediaWiki 1.43
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
  • service.version: 1.46.0-wmf.2
  • timestamp: 2025-11-11T09:48:40.027Z
  • labels.phpversion: 8.3.26
  • trace.id: c401c0a1-7594-436c-8bb5-1f72fe7fa2e8
  • Find trace.id in Logstash
labels.normalized_message
[{reqId}] {exception_url}   PHP Deprecated: Using bool as a message parameter was deprecated in MediaWiki 1.43
FrameLocationCall
from/srv/mediawiki/php-1.46.0-wmf.2/includes/libs/Message/ScalarParam.php(43)
#0[internal function]MediaWiki\Exception\MWExceptionHandler::handleError(int, string, string, int)
#1/srv/mediawiki/php-1.46.0-wmf.2/includes/libs/Message/ScalarParam.php(43)trigger_error(string, int)
#2/srv/mediawiki/php-1.46.0-wmf.2/includes/libs/Message/MessageValue.php(95)Wikimedia\Message\ScalarParam->__construct(Wikimedia\Message\ParamType, bool)
#3/srv/mediawiki/php-1.46.0-wmf.2/includes/libs/Message/MessageValue.php(38)Wikimedia\Message\MessageValue->params(string, string, string, string, int, string, string, string, bool, bool)
#4/srv/mediawiki/php-1.46.0-wmf.2/includes/libs/StatusValue.php(364)Wikimedia\Message\MessageValue->__construct(string, array)
#5/srv/mediawiki/php-1.46.0-wmf.2/includes/Output/OutputPage.php(3505)StatusValue->getMessages()
#6/srv/mediawiki/php-1.46.0-wmf.2/includes/Output/OutputPage.php(3469)MediaWiki\Output\OutputPage->formatPermissionStatus(MediaWiki\Permissions\PermissionStatus, string)
#7/srv/mediawiki/php-1.46.0-wmf.2/includes/Exception/PermissionsError.php(80)MediaWiki\Output\OutputPage->showPermissionStatus(MediaWiki\Permissions\PermissionStatus, string)
#8/srv/mediawiki/php-1.46.0-wmf.2/includes/Actions/ActionEntryPoint.php(146)MediaWiki\Exception\PermissionsError->report(int)
#9/srv/mediawiki/php-1.46.0-wmf.2/includes/MediaWikiEntryPoint.php(184)MediaWiki\Actions\ActionEntryPoint->execute()
#10/srv/mediawiki/php-1.46.0-wmf.2/index.php(44)MediaWiki\MediaWikiEntryPoint->run()
#11/srv/mediawiki/w/index.php(3)require(string)
#12{main}
Impact

Moderately noisy.

Notes
  • New in 1.46.0-wmf.2
  • All affected URIs include action=edit and the Translations: namespace, e.g. https://www.mediawiki.org/w/index.php?action=edit&title=Translations:*. Those pages also seem to be empty (as in: no translation existing yet).

Details

MediaWiki Version
1.46.0-wmf.2
Request URL
https://www.mediawiki.org/w/index.php?action=edit&title=*
Related Changes in Gerrit:

Event Timeline

Aklapper triaged this task as High priority.

Deprecation has been there a while, so it's seemingly a new usage...

https://github.com/wikimedia/mediawiki-extensions-Translate/compare/wmf/1.46.0-wmf.1...wmf/1.46.0-wmf.2 not seemingly in the Translate extension though, because it's just i18n updates...

I have a feeling this comes from T285612: Create parameter(s) to have the blocked message customize based on whether or not talk page access is revoked? I’m looking at some failures with a similar message from T409873, and I’m seeing parameters 8 and 9 (zero-indexed, so $9 and $10 as mentioned in tech news) being set to true and false.

image.png (632×292 px, 33 KB)

I guess this just needs to be changed to an 0 for false and 1 for true?

The idea was so that ParserFunctions #if could use it, but I think for that it would be a string anyway

Not "" (empty string) for false? At least that’s what the current code does after emitting the deprecation warning, if I’m not mistaken.

Not "" (empty string) for false? At least that’s what the current code does after emitting the deprecation warning, if I’m not mistaken.

Actually, yes. After reading https://www.mediawiki.org/wiki/Help:Extension:ParserFunctions##if that would be correct

I'll upload a fix for this shortly

Yeah, tested here as well – 0 is truthy for {{#if:}}.

(Also, it’s kind of worrying that this issue didn’t come up in CI for T285612… that patch updated and added some tests for the BlockErrorFormatter, but do we not have any integration tests [edit: in core – T409873 shows we have them elsewhere] that actually put a block error through the whole Message machinery?)

Change #1204579 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/core@master] BlockErrorFormatter: Convert booleans to string in message params

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

Good find. I could not reproduce this myself, but saw that it is about some ErrorPageError and that is where my investigation ran dry.

Adding to the Product Safety and Integrity sprint board for code review, as the code is within MediaWiki core blocking so is our area of code

MSantos subscribed.

Moving to the Radar for now as part of the MediaWiki-Engineering triage. Please, let me know if you need any other support from the MW Engineering Group.

Change #1204590 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Dreamy Jazz):

[mediawiki/core@wmf/1.46.0-wmf.2] BlockErrorFormatter: Convert booleans to string in message params

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

Change #1204590 merged by jenkins-bot:

[mediawiki/core@wmf/1.46.0-wmf.2] BlockErrorFormatter: Convert booleans to string in message params

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

Mentioned in SAL (#wikimedia-operations) [2025-11-12T15:06:43Z] <lucaswerkmeister-wmde@deploy2002> Started scap sync-world: Backport for [[gerrit:1204589|StringForLanguageBuilder: Use LanguageFallbackMode enum (T409876)]], [[gerrit:1204590|BlockErrorFormatter: Convert booleans to string in message params (T409810)]], [[gerrit:1133975|Enable DiscussionTools visual enhancements everywhere except enwiki, svwiki and ruwiki (T379264)]]

Mentioned in SAL (#wikimedia-operations) [2025-11-12T15:09:01Z] <lucaswerkmeister-wmde@deploy2002> lucaswerkmeister-wmde, jforrester, esanders: Backport for [[gerrit:1204589|StringForLanguageBuilder: Use LanguageFallbackMode enum (T409876)]], [[gerrit:1204590|BlockErrorFormatter: Convert booleans to string in message params (T409810)]], [[gerrit:1133975|Enable DiscussionTools visual enhancements everywhere except enwiki, svwiki and ruwiki (T379264)]] synced to the testservers (see

The convention of ParamValidator for such cases (e.g. rMW includes/libs/ParamValidator/TypeDef/FloatDef.php) is 1/2: that can be used with {{PLURAL:}}, which is core, not only with ParserFunctions’ {{#if:}}.

Using PLURAL for a boolean check seems a bit hacky, no? In the FloatDef example it's used for a real PLURAL check (because true in this case means multiple items).

As it stands the parameters are unused in the default message, so if a wiki wants to use them they can use ParserFunctions

Mentioned in SAL (#wikimedia-operations) [2025-11-12T15:23:59Z] <lucaswerkmeister-wmde@deploy2002> Finished scap sync-world: Backport for [[gerrit:1204589|StringForLanguageBuilder: Use LanguageFallbackMode enum (T409876)]], [[gerrit:1204590|BlockErrorFormatter: Convert booleans to string in message params (T409810)]], [[gerrit:1133975|Enable DiscussionTools visual enhancements everywhere except enwiki, svwiki and ruwiki (T379264)]] (duration: 17m 17s)

Should be fixed in production; the master branch version of the fix is blocked on a slightly elongated gate-and-submit queue, so by the time that’s merged we should be able to confirm in logstash that the warnings have stopped popping up and that the task is resolved.

Change #1204579 merged by jenkins-bot:

[mediawiki/core@master] BlockErrorFormatter: Convert booleans to string in message params

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