Page MenuHomePhabricator

tos-rc campaign breaks UploadWizard
Closed, ResolvedPublic

Description

https://commons.wikimedia.org/w/index.php?title=Special:UploadWizard&campaign=tos-rs shows the internal error page.

tos-rs is a photo competition campaign which starts on July so I suppose no one's hair is on fire (yet).

Event Timeline

Tgr raised the priority of this task from to High.
Tgr updated the task description. (Show Details)
Tgr subscribed.
Restricted Application added subscribers: Steinsplitter, Aklapper. · View Herald Transcript

Error is probably

Call to undefined method WikitextContent::getJsonData() in /srv/mediawiki/php1.26wmf11/extensions/UploadWizard/includes/UploadWizardCampaign.php on line 76

Fixed by running this script:

tgr@terbium:~$ mwscript eval.php --wiki=commonswiki
> $title = Title::newFromDBkey( 'Campaign:tos-rs' );
> $page = WikiPage::factory( $title );
> $oldData = $page->getContent()->getNativeData();
> $newContent = new CampaignContent( $oldData );
> $page->doEditContent( $newContent, 'Fixing content model', EDIT_UPDATE, false, User::newFromName( 'Tgr_(WMF)' ) );

Thanks for the pointers @Legoktm!

Follow-up:

  • add error handling in UW
  • add CampaignContent to the fixer script
  • identify source of error

Odder moved page User:Bojana Wiki PG/Campaign to Campaign:tos-rs without leaving a redirect: let's do it!

This should have either changed the content type (seems fragile) or failed with a clear error message telling the user to copy it by hand.

Change 222042 had a related patch set uploaded (by Gergő Tisza):
Check campaign content model

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

Tgr claimed this task.

Follow-up:

  • add error handling in UW

https://gerrit.wikimedia.org/r/#/c/222042/

  • add CampaignContent to the fixer script

Done.

  • identify source of error

T104408