Page MenuHomePhabricator

TypeError: Argument 9 passed to ContentTranslation\DTO\CXDraftTranslationDTO::__construct() must be of the type array or null, string given
Closed, ResolvedPublicPRODUCTION ERROR

Description

Error
labels.normalized_message
[{reqId}] {exception_url}   TypeError: Argument 9 passed to ContentTranslation\DTO\CXDraftTranslationDTO::__construct() must be of the type array or null, string given, called in /srv/mediawiki/php-1.42.0-wmf.1/extensions/ContentTranslation/includes/DTO/C
error.stack_trace
from /srv/mediawiki/php-1.42.0-wmf.1/extensions/ContentTranslation/includes/DTO/CXDraftTranslationDTO.php(26)
#0 /srv/mediawiki/php-1.42.0-wmf.1/extensions/ContentTranslation/includes/DTO/CXDraftTranslationDTO.php(60): ContentTranslation\DTO\CXDraftTranslationDTO->__construct(integer, string, string, string, string, string, string, array, string)
#1 /srv/mediawiki/php-1.42.0-wmf.1/extensions/ContentTranslation/includes/ActionApi/ApiQueryContentTranslation.php(221): ContentTranslation\DTO\CXDraftTranslationDTO::createFromTranslation(ContentTranslation\Translation)
#2 /srv/mediawiki/php-1.42.0-wmf.1/extensions/ContentTranslation/includes/ActionApi/ApiQueryContentTranslation.php(108): ContentTranslation\ActionApi\ApiQueryContentTranslation->serveDesktopEditorDraft(array)
#3 /srv/mediawiki/php-1.42.0-wmf.1/extensions/ContentTranslation/includes/ActionApi/ApiQueryContentTranslation.php(61): ContentTranslation\ActionApi\ApiQueryContentTranslation->run()
#4 /srv/mediawiki/php-1.42.0-wmf.1/includes/api/ApiQuery.php(695): ContentTranslation\ActionApi\ApiQueryContentTranslation->execute()
#5 /srv/mediawiki/php-1.42.0-wmf.1/includes/api/ApiMain.php(1931): ApiQuery->execute()
#6 /srv/mediawiki/php-1.42.0-wmf.1/includes/api/ApiMain.php(908): ApiMain->executeAction()
#7 /srv/mediawiki/php-1.42.0-wmf.1/includes/api/ApiMain.php(879): ApiMain->executeActionWithErrorHandling()
#8 /srv/mediawiki/php-1.42.0-wmf.1/api.php(95): ApiMain->execute()
#9 /srv/mediawiki/php-1.42.0-wmf.1/api.php(48): wfApiMain()
#10 /srv/mediawiki/w/api.php(3): require(string)
#11 {main}
Impact

Unclear.

Notes

16 of these in 1.42.0-wmf.1 (T348354).

Details

Request URL
https://he.wikipedia.org/w/api.php?action=query&format=*&from=*&list=*&sourcetitle=*&to=*&usecase=*

Event Timeline

brennen renamed this task from TypeError: Argument 9 passed to ContentTranslation\DTO\CXDraftTranslationDTO::__construct() must be of the type array or null, string given, called in /srv/mediawiki/php-1.42.0-wmf.1/extensions/ContentTranslation/includes/DTO/C to TypeError: Argument 9 passed to ContentTranslation\DTO\CXDraftTranslationDTO::__construct() must be of the type array or null, string given.Oct 19 2023, 3:31 PM
brennen updated the task description. (Show Details)

Change 967395 had a related patch set uploaded (by Nik Gkountas; author: Nik Gkountas):

[mediawiki/extensions/ContentTranslation@master] CXDraftTranslationDTO: Fix targetCategories type

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

Change 967395 merged by jenkins-bot:

[mediawiki/extensions/ContentTranslation@master] CXDraftTranslationDTO: Fix targetCategories type

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

Nikerabbit triaged this task as High priority.

Here is an example of the error being thrown in production:

image.png (1×1 px, 400 KB)

The same translation can now be restored as the issue has been resolved in production:

image.png (978×1 px, 256 KB)

Thus, this task can be considered as done.