Page MenuHomePhabricator

API: action=parse with redirects=1 and pageid given leads to missingparam error
Closed, ResolvedPublicBUG REPORT

Description

When performing an action=parse by pageid on a page with is not a redirect and trying to follow redirects by using redirects=1 a missingparam error is thrown even pageid is given. If the pageid points to a redirect, everything works fine.

Examples:
(1) https://de.wikipedia.org/w/index.php?curid=83614 is a non-redirect page

{
  "error": {
    "code": "missingparam",
    "info": "One of the parameters \"title\" and \"pageid\" is required.",
    "*": "See https://de.wikipedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."
  },
  "servedby": "mw1339"
}
{
  "parse": {
    "title": "Heiliger Abend",
    "pageid": 83614
  }
}

(2) https://de.wikipedia.org/w/index.php?curid=83615&redirect=no is a redirect page (to 83614)

{
  "parse": {
    "title": "Heiliger Abend",
    "pageid": 83615,
    "redirects": [
      {
        "from": "Heiligabend",
        "to": "Heiliger Abend"
      }
    ]
  }
}
{
  "parse": {
    "title": "Heiligabend",
    "pageid": 83615
  }
}

(empty prop= just for demonstration, has no effect on the request's results)

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
SD0001 changed the subtype of this task from "Task" to "Bug Report".Dec 23 2019, 1:44 PM

Change 560393 had a related patch set uploaded (by Anomie; owner: Anomie):
[mediawiki/core@master] ApiParse: Fix handling of pageid + redirects when passed a non-redirect

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

Change 560393 merged by jenkins-bot:
[mediawiki/core@master] ApiParse: Fix handling of pageid + redirects when passed a non-redirect

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

Anomie claimed this task.
Anomie subscribed.

The fix should be deployed to Wikimedia sites with 1.35.0-wmf.14 or later.