Page MenuHomePhabricator

Show block notices on mobile visual editor
Closed, ResolvedPublic

Description

On mobile visual editor, if a blocked user tries to edit a page (or a partially blocked user tries to edit a page they are blocked from), they are not told that they are blocked until after attempting to save the page.

On desktop visual editor, an edit notice appears as soon as the editor opens, warning them that they are blocked.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

This is actually not a big problem because if you're blocked, then the mobile site doesn't let you open the editor at all. When clicking on the "Edit" icon, a popup like this opens instead of the editor:

image.png (568×320 px, 54 KB)

However, this can be bypassed by viewing a veaction=edit URL (e.g. https://en.m.wikipedia.org/wiki/The_Fighting_Temeraire?veaction=edit), which is probably a separate bug.

Change 506467 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/extensions/MobileFrontend@master] Show block notice in VE

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

This is actually not a big problem because if you're blocked, then the mobile site doesn't let you open the editor at all. When clicking on the "Edit" icon, a popup like this opens instead of the editor:

However, this can be bypassed by viewing a veaction=edit URL (e.g. https://en.m.wikipedia.org/wiki/The_Fighting_Temeraire?veaction=edit), which is probably a separate bug.

Only if you haven't loaded the editor before and made VE your default.

Change 507375 had a related patch set uploaded (by Bartosz Dziewoński; owner: Esanders):
[mediawiki/extensions/VisualEditor@master] ApiVisualEditor: Return structured block info as well as formatted notice

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

Change 507375 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] ApiVisualEditor: Return structured block info as well as formatted notice

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

Change 506467 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Show block notice in VE

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

If I try to load visual editor on a page from which I am blocked, I get:

Error loading data from server: HTTP 500. Would you like to retry?

For a brief time yesterday, when I did the same thing the error was something like: "Call to private method ApiQueryUserInfo::getBlockInfo from ApiVisualEditor", but not today.

ve_block.png (1×1 px, 134 KB)

Change 508915 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/VisualEditor@master] ApiVisualEditor: Fix use of getBlockInfo()

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

Change 508915 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] ApiVisualEditor: Fix use of getBlockInfo()

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

Change 508941 had a related patch set uploaded (by Jforrester; owner: Bartosz Dziewoński):
[mediawiki/extensions/VisualEditor@wmf/1.34.0-wmf.4] ApiVisualEditor: Fix use of getBlockInfo()

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

Change 508941 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@wmf/1.34.0-wmf.4] ApiVisualEditor: Fix use of getBlockInfo()

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

Mentioned in SAL (#wikimedia-operations) [2019-05-08T21:58:03Z] <jforrester@deploy1001> Synchronized php-1.34.0-wmf.4/extensions/VisualEditor/includes/ApiVisualEditor.php: UBN T209599 ApiVisualEditor: Fix use of getBlockInfo() (duration: 00m 57s)

@dom_walden Thank you for noticing this! It should be displaying an appropriate message again now (on both desktop and mobile).

matmarex moved this task from QA to Product owner review on the VisualEditor (Current work) board.
matmarex edited projects, added Skipped QA; removed Editing QA.

This has been in production for a long time now and works as expected for me.

ppelberg claimed this task.

@matmarex for future reference, how do you go about testing patches that apply to contributors who are blocked?

I tested it on my local MediaWiki installation, where I created and blocked a user account. If you'd like to test it, I can give your account on https://en.wikipedia.beta.wmflabs.org/ the ability to block users (or I can just block it), just message me and tell me the username.