Page MenuHomePhabricator

Special:Upload fails on ":w:" as destination filename
Closed, ResolvedPublicBUG REPORT

Description

Steps to reproduce:

Actual result:

  • The spinner does not stop.
  • In the JavaScript console the error TypeError: result.query.pages is undefined occurs.

The API request https://www.mediawiki.org/w/api.php?action=query&format=json&formatversion=2&titles=W%3A&prop=imageinfo&iiprop=uploadwarning returns

{
  "batchcomplete": true,
  "query": {
    "normalized": [
      {
        "fromencoded": false,
        "from": "W:",
        "to": "w:"
      }
    ],
    "interwiki": [
      {
        "title": "w:",
        "iw": "w"
      }
    ]
  }
}

The expected key query.pages is missing in the response.

Event Timeline

Anomie subscribed.

You didn't specify any local titles, only an interwiki title. The API returned it as such.

The query key being absent when no local titles are supplied is longstanding API behavior, and is already filed as T33901: API: action=query with empty title set should still respond with "query" element. See that task for further discussion.

The query key being absent when no local titles are supplied is longstanding API behavior, and is already filed as T33901: API: action=query with empty title set should still respond with "query" element. See that task for further discussion.

The query key is present. The query.pages key is missing.

The same concerns raised in that task still apply.

Fomafix changed the subtype of this task from "Task" to "Bug Report".Mar 2 2019, 11:52 AM

Change 913261 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/core@master] upload: Improve report of invalid destination title on Special:Upload

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

Change 913261 merged by jenkins-bot:

[mediawiki/core@master] upload: Improve report of invalid destination title on Special:Upload

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