Page MenuHomePhabricator

Cannot get Main_Page of gbf.wiki from MCS
Closed, ResolvedPublic

Description

When I query MCS for a Main Page, I get the following:

{
  "status": 504,
  "type": "api_error",
  "title": "no mobileview in response",
  "detail": {
    "error": {
      "code": "unknown_action",
      "info": "Unrecognized value for parameter 'action': mobileview",
      "docref": "See https://gbf.wiki/api.php for API usage"
    }
  },
  "method": "GET",
  "uri": "/gbf.wiki/v1/page/mobile-sections/Main_Page"
}

http://localhost:6927/gbf.wiki/v1/page/mobile-sections/Main_Page

Relates to: https://github.com/openzim/mwoffliner/issues/388

Event Timeline

Hey there,

It looks like you're trying to use the MCS service on your own MediaWiki install? That error says it's unable to get the mobileview action, which is provided by the MobileFrontend extension. Do you have that installed?

Hey @Jdforrester-WMF,
I'm using a local instance of MCS, and pointing it at a remote MediaWiki instance that I don't have access to.
Other pages load, it's just the Main_Page that I can't get as a mobile view

Hey @Jdforrester-WMF,
I'm using a local instance of MCS, and pointing it at a remote MediaWiki instance that I don't have access to.
Other pages load, it's just the Main_Page that I can't get as a mobile view

Yup, that's because MCS currently has special code for the main page to use the one created in MobileFrontend, because Wikimedia wikis' main pages are generally not mobile-suitable. Eventually we expect this to change as communities switch over to responsive designs using the features of the TemplateStyles extension, but right now it's hacked in. You can disable this code by adding a hack in your local copy of https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/services/mobileapps/+/master/lib/mwapi.js#355 to point instead to https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/services/mobileapps/+/master/lib/mwapi.js#293 – but it may not be that simple, sorry.

@Isnit001 I believe the quickest and easiest hack to do what you want today (i.e., skip the Main Page special-casing) would be simply to comment out this line:

https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/services/mobileapps/+/master/routes/page/mobile-sections.js#218

Ideally this would be a configuration option.

Jhernandez claimed this task.
Jhernandez subscribed.

Related task to follow: https://phabricator.wikimedia.org/T173379

For now @Mholloway advice could work for you if you don't control the mediawiki instance and cant install mobilefrontend on it. 👍