Page MenuHomePhabricator

PHP Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
normalized_message
[{reqId}] {exception_url}   PHP Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated
FrameLocationCall
from/srv/mediawiki/php-1.44.0-wmf.14/extensions/ContentTranslation/includes/SiteMapper.php(109)
#0[internal function]MWExceptionHandler::handleError(int, string, string, int)
#1/srv/mediawiki/php-1.44.0-wmf.14/extensions/ContentTranslation/includes/SiteMapper.php(109)str_replace(string, null, string)
#2/srv/mediawiki/php-1.44.0-wmf.14/extensions/ContentTranslation/includes/ActionApi/ApiQueryContentTranslationSuggestions.php(225)ContentTranslation\SiteMapper::getApiURL(null, array)
#3/srv/mediawiki/php-1.44.0-wmf.14/extensions/ContentTranslation/includes/ActionApi/ApiQueryContentTranslationSuggestions.php(130)ContentTranslation\ActionApi\ApiQueryContentTranslationSuggestions->getExistingTitles(array)
#4/srv/mediawiki/php-1.44.0-wmf.14/extensions/ContentTranslation/includes/ActionApi/ApiQueryContentTranslationSuggestions.php(44)ContentTranslation\ActionApi\ApiQueryContentTranslationSuggestions->run()
#5/srv/mediawiki/php-1.44.0-wmf.14/includes/api/ApiQuery.php(727)ContentTranslation\ActionApi\ApiQueryContentTranslationSuggestions->execute()
#6/srv/mediawiki/php-1.44.0-wmf.14/includes/api/ApiMain.php(1973)MediaWiki\Api\ApiQuery->execute()
#7/srv/mediawiki/php-1.44.0-wmf.14/includes/api/ApiMain.php(941)MediaWiki\Api\ApiMain->executeAction()
#8/srv/mediawiki/php-1.44.0-wmf.14/includes/api/ApiMain.php(912)MediaWiki\Api\ApiMain->executeActionWithErrorHandling()
#9/srv/mediawiki/php-1.44.0-wmf.14/includes/api/ApiEntryPoint.php(152)MediaWiki\Api\ApiMain->execute()
#10/srv/mediawiki/php-1.44.0-wmf.14/includes/MediaWikiEntryPoint.php(202)MediaWiki\Api\ApiEntryPoint->execute()
#11/srv/mediawiki/php-1.44.0-wmf.14/api.php(44)MediaWiki\MediaWikiEntryPoint->run()
#12/srv/mediawiki/w/api.php(3)require(string)
#13{main}
Impact
Notes

Event Timeline

			$sourceLanguage = $params['from'];
			$targetLanguage = $params['to'];

Both params are not required, and use a default of null...

			'from' => [
				ParamValidator::PARAM_TYPE => 'string',
				ParamValidator::PARAM_REQUIRED => false,
			],
			'to' => [
				ParamValidator::PARAM_TYPE => 'string',
				ParamValidator::PARAM_REQUIRED => false,
			],

Change #1115843 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/ContentTranslation@master] ApiQueryContentTranslationSuggestions: Set default value for to and from parameters

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

Reedy changed the task status from Open to In Progress.Jan 31 2025, 1:07 PM

Change #1115843 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] ApiQueryContentTranslationSuggestions: Set default value for to and from parameters

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

Change #1115864 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/ContentTranslation@REL1_43] ApiQueryContentTranslationSuggestions: Set default value for to and from parameters

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

Reedy claimed this task.

Change #1115864 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@REL1_43] ApiQueryContentTranslationSuggestions: Set default value for to and from parameters

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

Change #1116788 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/extensions/ContentTranslation@wmf/1.44.0-wmf.14] ApiQueryContentTranslationSuggestions: Set default value for to and from parameters

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

Change #1116788 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@wmf/1.44.0-wmf.14] ApiQueryContentTranslationSuggestions: Set default value for to and from parameters

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

Mentioned in SAL (#wikimedia-operations) [2025-02-03T13:27:08Z] <reedy@deploy2002> Started scap sync-world: Backport for [[gerrit:1116783|Add missing array_values for PHP 7 compatibility (T385255)]], [[gerrit:1116784|SpecialMathWikibase: Null-coalescence getDescription() call (T385170)]], [[gerrit:1116785|SpecialMathWikibase: Null-coalescence $par (T385269)]], [[gerrit:1116788|ApiQueryContentTranslationSuggestions: Set default value for to and from parameters (T385267)]]

Mentioned in SAL (#wikimedia-operations) [2025-02-03T13:34:08Z] <reedy@deploy2002> reedy: Backport for [[gerrit:1116783|Add missing array_values for PHP 7 compatibility (T385255)]], [[gerrit:1116784|SpecialMathWikibase: Null-coalescence getDescription() call (T385170)]], [[gerrit:1116785|SpecialMathWikibase: Null-coalescence $par (T385269)]], [[gerrit:1116788|ApiQueryContentTranslationSuggestions: Set default value for to and from parameters (T385267)]] synced to the testservers (h

Mentioned in SAL (#wikimedia-operations) [2025-02-03T13:43:52Z] <reedy@deploy2002> Finished scap sync-world: Backport for [[gerrit:1116783|Add missing array_values for PHP 7 compatibility (T385255)]], [[gerrit:1116784|SpecialMathWikibase: Null-coalescence getDescription() call (T385170)]], [[gerrit:1116785|SpecialMathWikibase: Null-coalescence $par (T385269)]], [[gerrit:1116788|ApiQueryContentTranslationSuggestions: Set default value for to and from parameters (T385267)]] (duration