Page MenuHomePhabricator

Zeroconf Parsoid + VisualEditor doesn't work with MediaWiki-Docker
Closed, ResolvedPublic

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:

image.png (245×375 px, 14 KB)

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

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...

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.

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

@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

matmarex subscribed.

This problem should no longer occur on MediaWiki 1.41 and later, as VisualEditor no longer uses HTTP requests internally to contact Parsoid, it just calls the PHP methods directly (see T320529 for related work).

I will optimistically close this task, but if anyone here understands what exactly it was about, it would be nice if you could try it again with MediaWiki 1.41 and confirm that it works, or reopen the task.