What is the problem?
The drawer which normally appears at the bottom of the screen (screenshot) when attempting to edit a page you are blocked from no longer appears.
It appears to start happening after this change: https://gerrit.wikimedia.org/r/c/mediawiki/extensions/MobileFrontend/+/482385, part of task T149909.
It occurs on beta (1.34.0-alpha (6aacbeb)) and test (1.34.0-wmf.14 (rMW33d36902714e)).
When attempting to edit a page you are blocked from, I don't see any likely errors or warnings in the javascript console.
I see an API request like: api.php?action=query&format=json&formatversion=2&prop=revisions%7Cinfo&rvprop=content%7Ctimestamp&titles=$article&intestactions=edit&intestactionsdetail=full&rvsection=0, which returns a JSON string like: P8782.
Steps to reproduce problem
- Use Special:Block to block $user
- Login as $user
- At the bottom of the page, click "Mobile view"
- Go to an article you are blocked from and click the pen icon to attempt to edit
Expected behavior: Drawer appears with the block details (as in screenshot)
Observed behavior: Page reloads, but nothing appears to happen
Screenshots (if applicable):
Developer notes
Can be replicated with
diff --git a/src/mobile.editor.overlay/EditorGateway.js b/src/mobile.editor.overlay/EditorGateway.js index 034e6eca4..562b57867 100644 --- a/src/mobile.editor.overlay/EditorGateway.js +++ b/src/mobile.editor.overlay/EditorGateway.js @@ -95,14 +95,17 @@ EditorGateway.prototype = { if ( util.isNumeric( this.sectionId ) ) { options.rvsection = this.sectionId; } - return this.api.get( options ).then( function ( resp ) { + return $.Deferred().resolve( {"batchcomplete":true,"warnings":{"main":{"warnings":"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. Use [[Special:ApiFeatureUsage]] to see usage of deprecated features by your application."},"revisions":{"warnings":"Because \"rvslots\" was not specified, a legacy format has been used for the output. This format is deprecated, and in the future the new format will always be used."}},"query":{"pages":[{"pageid":49877,"ns":0,"title":"Spam","revisions":[{"timestamp":"2009-06-20T12:07:26Z","contentformat":"text/x-wiki","contentmodel":"wikitext","content":"Hello, World! (Bot test; should be reverted in about one minute)"}],"contentmodel":"wikitext","pagelanguage":"en","pagelanguagehtmlcode":"en","pagelanguagedir":"ltr","touched":"2012-11-02T18:54:26Z","lastrevid":75276,"length":64,"new":true,"actions":{"edit":[{"code":"blocked","text":"You have been blocked from editing.","data":{"blockinfo":{"blockid":18003,"blockedby":"Dom walden","blockedbyid":42287,"blockreason":"","blockedtimestamp":"2019-07-15T08:04:52Z","blockexpiry":"infinite","blockpartial":false}}}]}}]}}) + .then( function ( resp ) { var revision, pageObj; + console.log('resp', resp.error); if ( resp.error ) { return util.Deferred().reject( resp.error.code ); } pageObj = resp.query.pages[0]; + console.log('resp', pageObj); // page might not exist and caller might not have known. if ( pageObj.missing !== undefined ) { self.content = ''; @@ -115,6 +118,7 @@ EditorGateway.prototype = { // save content a second time to be able to check for changes self.originalContent = self.content; self.blockinfo = self.getBlockInfo( pageObj ); + console.log(self.blockinfo); return resolve(); } );