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

hgzh created this task.Dec 23 2019, 11:29 AM
Restricted Application added a project: Core Platform Team. · View Herald TranscriptDec 23 2019, 11:29 AM
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 closed this task as Resolved.Jan 2 2020, 8:23 PM
Anomie claimed this task.
Anomie added a subscriber: Anomie.

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

hgzh awarded a token.Jan 13 2020, 12:58 PM