Page MenuHomePhabricator

CodeMirror syntax highlighting doesn't work when importing a file
Closed, ResolvedPublic2 Estimated Story Points

Description

While reviewing the patch for T274274: FileImporter constructs EditPage for a special page, I realized the exact same lines of code are responsible for another issue: As of now, MediaWiki-extensions-CodeMirror doesn't show up in the WikiEditor (2010) toolbar when editing the wikitext while importing a file. This is because CodeMirror thinks …

  • the page is not in edit mode, and
  • it's not a wikitext page but a special page.

Context for devs: What our WikitextEditor class does is actually re-implementing a small piece of the EditPage class – the piece that is responsible for running the EditPage::showEditForm:initial hook. We need to fake the context just so much that extensions relying on this hook are satisfied.

Event Timeline

Change 663038 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Daniel Kinzler):
[mediawiki/extensions/FileImporter@master] Fix wrong context title in WikitextEditor

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

thiemowmde set the point value for this task to 2.Feb 10 2021, 9:09 AM
thiemowmde moved this task from Backlog to In sprint on the WMDE-Templates-FocusArea board.
thiemowmde moved this task from Backlog to Tickets in sprint on the Move-Files-To-Commons board.

Change 663038 merged by jenkins-bot:
[mediawiki/extensions/FileImporter@master] Fix wrong context title in WikitextEditor

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

Lena_WMDE moved this task from Demo to Done on the WMDE-TechWish (Sprint-2021-02-03) board.