Page MenuHomePhabricator

Remove usage of User::isBlockedGlobally and User::getGlobalBlock in VisualEditor
Closed, ResolvedPublic2 Estimated Story Points

Description

Following T257701: Add global blocks into CompositeBlocks rather than treating them separately
Remove usage of User::isBlockedGlobally and User::getGlobalBlock in VisualEditor

Usage of User::isBlockedGlobally found here
Usage of User::getGlobalBlock found here

Testing

  • Block an IP address or User.
  • Access the visual editor menu(Edit).If IP is blocked, you will get a message why its blocked and by who.Otherwise, you should be able to edit using the visual editor.

Event Timeline

Change 856527 had a related patch set uploaded (by Cyndywikime; author: Cyndywikime):

[mediawiki/extensions/VisualEditor@master] Remove usage of User::isBlockedGlobally and User::getGlobalBlock

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

Cyndymediawiksim updated the task description. (Show Details)
Cyndymediawiksim updated the task description. (Show Details)
Tchanders added a subscriber: GMikesell-WMF.

@GMikesell-WMF If you're testing this one, it might be easiest to test it on Beta rather than setting up VisualEditor locally. You may need to be logged in, and you may need to go to Special:Preferences#mw-prefsection-editing to ensure VisualEditor is enabled.

Change 856527 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Remove usage of User::isBlockedGlobally and User::getGlobalBlock

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

@Tchanders I validated that I was receiving a block message when testing global block IP, range, local sitewide, and composite blocks as seen in the screenshots below. I could not do XFF since it doesn't work in beta but can test it locally if you want me to.

Is the block message error coming up as a notification fine, compared to how it usually shows the block message on the whole page?
Also, is it ok that the Local block notification is different than the other Global block messages since it's in the yellow block?

Test Environment: Beta

Browser: Chrome

Global Block IP

T318898_VisualEditing_GB_IP_Chrome_Pass.png (992×1 px, 455 KB)

Global Block IP Range

T318898_VisualEditing_GB_IPRange_Chrome_Pass.png (1×1 px, 419 KB)

Local Block Sitewide

T318898_VisualEditing_GB_LocalBlock_Chrome_Pass.png (1×1 px, 415 KB)

Composite Block

T318898_VisualEditing_GB_CompositeBlock_Chrome_Pass.png (1×2 px, 430 KB)

I could not do XFF since it doesn't work in beta but can test it locally if you want me to.

Thanks @GMikesell-WMF. I don't think that's necessary, as the code change is small and doesn't treat XFF blocks differently.

Is the block message error coming up as a notification fine, compared to how it usually shows the block message on the whole page?

That's fine - this is just how the visual editor displays messages.

Also, is it ok that the Local block notification is different than the other Global block messages since it's in the yellow block?

That's fine too - it just means that the translation for this message has been overridden on the wiki to add some styling. (Here's the page that one can edit to override this message: https://en.m.wikipedia.beta.wmflabs.org/wiki/MediaWiki:Blockedtext)

@Tchanders Got it, thanks! If that's the case, everything looks good, and I will be moving this to Done.