Jump to content

Topic on Talk:RESTBase/Installation

Restbase runs partially: /page/title/<title> works; /page/html/<title> not so much

3
Summary by Kghbln

Make sure that Parsoid is loaded for MW 1.35 and later if VisualEditor is not installed.

wfLoadExtension(
    'Parsoid',
    'vendor/wikimedia/parsoid/extension.json'
);
Oetterer (talkcontribs)

Hey folks

After some hair loss and much poking in the dark I got my RESTBase partially running. As stated in the title, I can access the RESTBase via curl and browser and I can get title information about a page with /page/title/Hauptseite (german wiki obviously). Alas, when I try to get content with /page/html/Hauptseite I get a 404:

{
  "type": "https://mediawiki.org/wiki/HyperSwitch/errors/not_found",
  "title": "Not found.",
  "method": "get",
  "uri": "/www.mywiki.de/v1/page/html/Hauptseite"
}

as opposed to /page/title/Hauptseite where I get

{
  "items": [
    {
      "title": "Hauptseite",
      "page_id": 11,
      "rev": 1319,
      "tid": "7a70c820-7d1c-11eb-9913-fb7beb5297c0",
      "namespace": 0,
      "user_id": 12,
      "user_text": "Anon",
      "timestamp": "2021-01-26T15:50:46Z",
      "comment": "",
      "tags": [
        "visualeditor-wikitext"
      ],
      "restrictions": [],
      "page_language": "de",
      "redirect": false
    }
  ]
}

Any pointers where I could search for my mistake?

System is:

  • MW 1.35
  • PHP 7.4
  • Node: v10.19.0

What might be of importance: the apache redirects ALL requests to port 80 to port 443 (so all http traffic will be redirected to https). Therefore I used the following in my config.yaml:

Oh, and https://www.mywiki.de/w/rest.php/v1/page/Hauptseite works just fine.

Any help appreciated, thanks in advance!

Oetterer (talkcontribs)

Posting the cause of my error here in case someone else has the same problem:

I installed RESTBase on a 1.35 wiki w/o VisualEditor, b/c I wanted to see RESTBase running, before tackling VE. But on a normal wiki, parsoid is not loaded. So if you run in the aforementioned problem, either install and activate VisualEditor or add the following to your LocalSettings.php:

wfLoadExtension( 'Parsoid', 'vendor/wikimedia/parsoid/extension.json' );
This post was hidden by Oetterer (history)