Page MenuHomePhabricator

TranslationStashActionApi: json_decode(): Passing null to parameter #1 ($json) of type string is deprecated
Closed, ResolvedPublic1 Estimated Story Points

Description

[2024-06-05T03:23:22.866847+00:00] error.WARNING: [04e791c9ac053c63e0df1368] /w/api.php   PHP Deprecated: json_decode(): Passing null to parameter #1 ($json) of type string is deprecated
 {"exception":"[object] (ErrorException(code: 0): PHP Deprecated: json_decode(): Passing null to parameter #1 ($json) of type string is deprecated at /srv/mediawiki/tags/2024-06-04_12:43
:27/includes/json/FormatJson.php:151)
[stacktrace]
#0 [internal function]: MWExceptionHandler::handleError()
#1 /srv/mediawiki/tags/2024-06-04_12:43:27/includes/json/FormatJson.php(151): json_decode()
#2 /srv/mediawiki/tags/2024-06-04_12:43:27/extensions/Translate/src/TranslatorSandbox/TranslationStashActionApi.php(74): MediaWiki\\Json\\FormatJson::decode()
#3 /srv/mediawiki/tags/2024-06-04_12:43:27/includes/api/ApiMain.php(1952): MediaWiki\\Extension\\Translate\\TranslatorSandbox\\TranslationStashActionApi->execute()
#4 /srv/mediawiki/tags/2024-06-04_12:43:27/includes/api/ApiMain.php(928): ApiMain->executeAction()
#5 /srv/mediawiki/tags/2024-06-04_12:43:27/includes/api/ApiMain.php(899): ApiMain->executeActionWithErrorHandling()
#6 /srv/mediawiki/tags/2024-06-04_12:43:27/includes/api/ApiEntryPoint.php(158): ApiMain->execute()
#7 /srv/mediawiki/tags/2024-06-04_12:43:27/includes/MediaWikiEntryPoint.php(200): MediaWiki\\Api\\ApiEntryPoint->execute()
#8 /srv/mediawiki/tags/2024-06-04_12:43:27/api.php(44): MediaWiki\\MediaWikiEntryPoint->run()
#9 {main}
","exception_url":"/w/api.php","reqId":"04e791c9ac053c63e0df1368","caught_by":"mwe_handler"} []

Event Timeline

Change #1038929 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/Translate@master] TranslationStashActionApi: Check null before calling FormatJson::decode

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

abi_ triaged this task as Medium priority.
abi_ set the point value for this task to 1.

Change #1038929 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] TranslationStashActionApi: Check null before calling FormatJson::decode

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

No more occurrences of this error since the patch was deployed on translatewiki.