Page MenuHomePhabricator

Zeroconf Parsoid + VisualEditor doesn't work with MediaWiki-Docker
Open, Needs TriagePublic

Description

Inspired by T260002: Bundled Parsoid for VisualEditor doesn't work in mediawiki-docker-dev (but that is a separate development environment), this task is about having zero-configuration Parsoid + VisualEditor work with the development environment provided with MediaWiki core.

The environment provided by core uses SQLite as the default, so this task will also be blocked on T259685 unless/until we move MediaWiki-Docker to use MySQL as the default backend.

But there is a problem that occurs before we reach that point:

Steps to reproduce:

  • Download core in a new directory
  • Follow the instructions in DEVELOPERS.md in core to bring up the environment
  • Download VisualEditor and run git submodule --init, also load the extension in LocalSettings.php
  • Try to edit Main_Page

Event Timeline

kostajh created this task.Aug 27 2020, 10:14 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 27 2020, 10:14 AM
ppelberg moved this task from Backlog to External on the Editing-team (Tracking) board.
ppelberg moved this task from To Triage to Triaged on the VisualEditor board.
DLynch added a subscriber: DLynch.Sep 8 2020, 2:53 PM

A possible indicator of whatever's going wrong: the visualeditor API parse call always returns Main_Page regardless of what was requested.

e.g. I created a page called Sandbox (not via VisualEditor because of T259685), and then tried to edit it with VisualEditor. The following API request was made: http://localhost:8080/api.php?action=visualeditor&format=jsonfm&paction=parse&page=Sandbox&uselang=en&formatversion=2&oldid=2

The response came back as a success, but the content field contained the appropriate values for Main_Page rather than for Sandbox.

Then, unrelated to it receiving the wrong page, the code looking for a revisionid in the response document does documentElement.getAttribute( 'about' ) to look for the revisionid there, and discovers that there's no about element. This is why it claims to have found revisionid 0.

It's possible that this is being an issue independent of the docker/sqlite setup due to some less-used codepaths -- this is the non-restbase route, which is why the parse call is happening. None of our production sites have this setup, so...

DLynch added a comment.Sep 8 2020, 3:16 PM

It's possible that this is being an issue independent of the docker/sqlite setup due to some less-used codepaths -- this is the non-restbase route, which is why the parse call is happening. None of our production sites have this setup, so...

That said, making an equivalent API request over on enwiki, the parse output does include the about attribute.

DLynch added a comment.Sep 8 2020, 4:46 PM

@kostajh suggested I downgrade the docker image to 0.3.0 (from 0.5.0), which stopped this error from occurring.

kostajh added a comment.EditedSep 9 2020, 8:04 PM

@kostajh suggested I downgrade the docker image to 0.3.0 (from 0.5.0), which stopped this error from occurring.

This is tracked in T261051: MediaWiki Docker does not support rest.php