Steps to replicate the issue (include links if applicable):
- Open the CX dashboard on desktop, and select an in-progress translation to continue. If you don't have any draft translation, you should create one before following these steps.
- Continue to the desktop editor
What happens?:
An error message saying Unable to fetch draft information. appears and the draft translation is not restored. The API request that fetches the draft returns with the following execution error:
"error": {
"code": "internal_api_error_TypeError",
"info": "[8d317714-89b9-47a1-a608-aaa5dce0e784] Exception caught: ContentTranslation\\Translation::getStatus(): Return value must be of type string, null returned",
"errorclass": "TypeError",
"trace": "TypeError at /srv/mediawiki/php-1.45.0-wmf.10/extensions/ContentTranslation/includes/Translation.php(129)\nfrom /srv/mediawiki/php-1.45.0-wmf.10/extensions/ContentTranslation/includes/Translation.php(129)\n#0 /srv/mediawiki/php-1.45.0-wmf.10/extensions/ContentTranslation/includes/ActionApi/ApiQueryContentTranslation.php(209): ContentTranslation\\Translation->getStatus()\n#1 /srv/mediawiki/php-1.45.0-wmf.10/extensions/ContentTranslation/includes/ActionApi/ApiQueryContentTranslation.php(100): ContentTranslation\\ActionApi\\ApiQueryContentTranslation->serveDesktopEditorDraft(array)\n#2 /srv/mediawiki/php-1.45.0-wmf.10/extensions/ContentTranslation/includes/ActionApi/ApiQueryContentTranslation.php(52): ContentTranslation\\ActionApi\\ApiQueryContentTranslation->run()\n#3 /srv/mediawiki/php-1.45.0-wmf.10/includes/api/ApiQuery.php(745): ContentTranslation\\ActionApi\\ApiQueryContentTranslation->execute()\n#4 /srv/mediawiki/php-1.45.0-wmf.10/includes/api/ApiMain.php(2016): MediaWiki\\Api\\ApiQuery->execute()\n#5 /srv/mediawiki/php-1.45.0-wmf.10/includes/api/ApiMain.php(954): MediaWiki\\Api\\ApiMain->executeAction()\n#6 /srv/mediawiki/php-1.45.0-wmf.10/includes/api/ApiMain.php(925): MediaWiki\\Api\\ApiMain->executeActionWithErrorHandling()\n#7 /srv/mediawiki/php-1.45.0-wmf.10/includes/api/ApiEntryPoint.php(152): MediaWiki\\Api\\ApiMain->execute()\n#8 /srv/mediawiki/php-1.45.0-wmf.10/includes/MediaWikiEntryPoint.php(198): MediaWiki\\Api\\ApiEntryPoint->execute()\n#9 /srv/mediawiki/php-1.45.0-wmf.10/api.php(44): MediaWiki\\MediaWikiEntryPoint->run()\n#10 /srv/mediawiki/w/api.php(3): require(string)\n#11 {main}"
},The issue is caused by this patch: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/ContentTranslation/+/1163413
What should have happened instead?:
No error should appear, the API request should return the draft information and the corresponding translation units and the draft translation should be properly restored.
Screencast from test wiki
Derived Requirement
When resuming an in-progress translation from the CX dashboard in desktop mode, the draft restoration API should return complete draft data without error, and the editor should load the previously saved translation units. The API must not fail due to missing or null values (e.g., in Translation::getStatus()), and draft restoration should function reliably after https://gerrit.wikimedia.org/r/1163413.
Test Result - TestWiki
Status: ✅ PASS / ❓Need More Info / ❌ FAIL
Environment: beta/xyzwiki
OS: macOS Sequoia 15.5
Browser: Chrome 138
Device: MBA
Emulated Device: NA
Test Artifact(s):
Test Steps
Test Case 1: Ensure draft translation is properly restored in CX desktop editor
- Go to Special:ContentTranslation on desktop.
- Start a new translation of any article from source language (e.g., English) to a target language (e.g., French).
- Translate a few units (lead section or more) and wait for the draft to auto-save.
- Return to the CX dashboard.
- Select the in-progress translation to continue.
- ✅❓❌⬜ AC1: Confirm that no error appears (e.g., "Unable to fetch draft information").
- ✅❓❌⬜ AC2: Confirm that the draft loads successfully and all previously translated content is restored in the editor.
Test Case 2: Ensure API response for draft includes valid status
- Open browser dev tools → Network tab.
- Resume an in-progress translation from the CX dashboard.
- Filter for the API call related to the draft (e.g., action=query&meta=contenttranslation).
- ✅❓❌⬜ AC3: Confirm that the API response includes a valid "status" field and does not return an internal server error.
QA Results - TestWiki
| AC | Status | Details |
|---|---|---|
| 1 | ✅ | T399732#11011404 |
| 2 | ✅ | T399732#11011404 |
| 3 | ✅ | T399732#11011404 |