Page MenuHomePhabricator

thumbwidth undefined
Closed, ResolvedPublic

Description

Issue 1: mobile-html on zhwiki

While researching the parent issue, I noticed that the action=mobileview request did not provide a value for thumbwidth.

Our request looks like:
https://zh.wikipedia.org/w/api.php?format=json&formatversion=2&action=mobileview&page=MediaWiki%3AConversiontable%2Fzh-hans&prop=text%7Csections%7Clanguagecount%7Cthumb%7Cimage%7Cid%7Crevision%7Cdescription%7Clastmodified%7Cnamespace%7Cnormalizedtitle%7Cdisplaytitle%7Cprotection%7Ceditable&sections=all&sectionprop=toclevel%7Cline%7Canchor&noheadings=true&thumbwidth=

which returns:

{
    "error": {
        "code": "badinteger",
        "info": "Invalid value \"\" for integer parameter \"thumbwidth\".",
        "docref": "See https://zh.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."
    }
}

Issue 2: mobile-sections of File pages

The other issue detected in the code was in mobile-sections output:
Example URL: http://localhost:8888/commons.wikimedia.org/v1/page/mobile-sections/File:The%20Golden%20Gate%20Bridge%20and%20Comet%20C2020%20F3%20NEOWISE%20and.jpg
The "imageinfo" property was not showing thumburl, thumbwidth, and thumbheight.

Actual
"imageinfo": {
  "url": "https://upload.wikimedia.org/wikipedia/commons/8/85/The_Golden_Gate_Bridge_and_Comet_C2020_F3_NEOWISE_and.jpg",
  "descriptionurl": "https://commons.wikimedia.org/wiki/File:The_Golden_Gate_Bridge_and_Comet_C2020_F3_NEOWISE_and.jpg",
  "descriptionshorturl": "https://commons.wikimedia.org/w/index.php?curid=92180852"
},

Expected

"imageinfo": {
  "thumburl": "https://upload.wikimedia.org/wikipedia/commons/thumb/8/85/The_Golden_Gate_Bridge_and_Comet_C2020_F3_NEOWISE_and.jpg/800px-The_Golden_Gate_Bridge_and_Comet_C2020_F3_NEOWISE_and.jpg",
  "thumbwidth": 800,
  "thumbheight": 533,
  "url": "https://upload.wikimedia.org/wikipedia/commons/8/85/The_Golden_Gate_Bridge_and_Comet_C2020_F3_NEOWISE_and.jpg",
  "descriptionurl": "https://commons.wikimedia.org/wiki/File:The_Golden_Gate_Bridge_and_Comet_C2020_F3_NEOWISE_and.jpg",
  "descriptionshorturl": "https://commons.wikimedia.org/w/index.php?curid=92180852"
},

Event Timeline

Change 612439 had a related patch set uploaded (by BearND; owner: BearND):
[mediawiki/services/mobileapps@master] zh: fix thumbwidth undefined

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

LGoto triaged this task as Medium priority.Jul 14 2020, 3:36 PM
bearND renamed this task from zhwiki mobile-html: thumbwidth undefined to thumbwidth undefined.Jul 14 2020, 6:37 PM
bearND updated the task description. (Show Details)

Change 612439 merged by jenkins-bot:
[mediawiki/services/mobileapps@master] Fix thumbwidth undefined

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