Page MenuHomePhabricator

ContentTranslation errors when deleting previously published draft
Closed, ResolvedPublicPRODUCTION ERROR

Description

From Logstash:

Catchable fatal error: Argument 2 passed to ContentTranslation\Translation::update() must be an instance of ContentTranslation\Translator, undefined variable given in /srv/mediawiki/php-1.29.0-wmf.17/extensions/ContentTranslation/includes/Translation.php	18
Warning: update() expects exactly 2 parameters, 0 given in /srv/mediawiki/php-1.29.0-wmf.17/extensions/ContentTranslation/includes/Translation.php on line 46

Grep shows:

api/ApiContentTranslationDelete.php
35-             if ( $translation->translation['targetURL'] !== null ) {
36-                     // Translation was once published. Don't delete, move it to published status.
37-                     $translation->translation['status'] = 'published';
38:                     $translation->update();

Update call has been forgotten to be updated in a refactoring that happened some time back. It should be:

$translation->update( [], $translator );

Event Timeline

Change 344947 had a related patch set uploaded (by KartikMistry):
[mediawiki/extensions/ContentTranslation@master] Fix update call in ApiContentTranslationDelete

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

Change 344947 merged by jenkins-bot:
[mediawiki/extensions/ContentTranslation@master] Fix update call in ApiContentTranslationDelete

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

Amire80 claimed this task.
Amire80 triaged this task as Medium priority.
Amire80 moved this task from Needs Triage to Bugs on the ContentTranslation board.
mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:10 PM