Page MenuHomePhabricator

Edit icon should show as locked when user is blocked from editing.
Closed, ResolvedPublic2 Estimated Story Points

Description

A user who is blocked from editing a page sees a normal edit icon.

The icon for pages which are blocked shows as the edit pencil (mw-ui-icon-minerva-edit-enabled) and NOT the locked edit pencil (mw-ui-icon-minerva-edit)

Expected

  • Edit shows with locked icon
  • Clicking toast shows a message explaining the block

Screen Shot 2018-04-05 at 3.22.40 PM.png (576×404 px, 139 KB)

Actual

  • Edit shows without locked icon
  • Clicking toast shows a message explaining the block

Screen Shot 2018-04-05 at 3.21.36 PM.png (581×393 px, 137 KB)

Acceptance criteria

  • If a user is blocked the edit icon in page actions and section headings should be displayed with the lock pencil (mw-ui-icon-minerva-edit)
  • The talk page should not be identified as uneditable

Developer notes

In Minerva we pass a config variable "wgMinervaUserBlockInfo". If this suggests the user is blocked, the edit pencil should be locked.

Reproduction steps

setup

  • Create account BlockedUser You can create a block locally for that account with an admin account by visiting Special:BlockUser.
    • Make sure to untick all boxes - in particular "Prevent this user from editing their own talk page while blocked" unticked (for test) and for your sanity do not "Prevent account creation" or "Automatically block the last IP address used by this user, and any subsequent IP addresses they try to edit from" (if you do you'll need to delete the block in ipblocks table in your database.

Test

  • Login as BlockedUser
  • Visit User:BlockedUser when clicking talk and confirm that when clicking add discussion you can add topics
  • Visit User_talk:BlockedUser as BlockedUser and the edit icon should be visible and without a lock icon. When you click it you should be able to type and save the edit.
  • When visiting any other page - the edit icon appears with a lock. Clicking it shows a blocked message.

Event Timeline

ovasileva triaged this task as Medium priority.Mar 27 2018, 3:52 PM

Change 422420 had a related patch set uploaded (by Niedzielski; owner: Stephen Niedzielski):
[mediawiki/skins/MinervaNeue@master] Fix: check if user is blocked to show edit button

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

@pmiazga, will you help me by reviewing this task? The lines changed are few but I'm sure there's some subtleties I'm missing.

Change 424157 had a related patch set uploaded (by Niedzielski; owner: Stephen Niedzielski):
[mediawiki/extensions/MobileFrontend@master] Fix: do not block allowed edits to user talk pages

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

Change 424157 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] Fix: do not block allowed edits to user talk pages

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

This can probably skip design review but let me know

This is related to T190613.

In fact it looks like the same...your fix seems to solve the problem there. I will verify

Change 422420 merged by jenkins-bot:
[mediawiki/skins/MinervaNeue@master] Fix: check if user is blocked to show edit button

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

Hang out. I think I've got confused here since T190613 is so similar... let me take some time to stop adding further confusion..

Change 424471 had a related patch set uploaded (by Jdlrobson; owner: Jdlrobson):
[mediawiki/skins/MinervaNeue@master] Revert "Fix: check if user is blocked to show edit button"

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

Jdlrobson removed a project: good first task.

My bad. This is not fixed. When testing I was actually testing T190613.
With the above patch the icon does not show at all now - which is super confusing for a blocked user. I've reverted the patch and updated the description to make this task clearer. Sorry for the turbulence and confusion.

Change 424471 merged by jenkins-bot:
[mediawiki/skins/MinervaNeue@master] Revert "Fix: check if user is blocked to show edit button"

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

I am seeing the messaging at the bottom of the page, but the icon is displayed as editable. I will wait for T190834 before moving to sign-off

Change 424663 had a related patch set uploaded (by Niedzielski; owner: Stephen Niedzielski):
[mediawiki/skins/MinervaNeue@master] Fix: update edit button lock style state

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

Change 424663 merged by jenkins-bot:
[mediawiki/skins/MinervaNeue@master] Fix: update edit button lock style state

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

I must have mis-pasted the ticket link above. I am not sure which ticket is blocking, but I am still seeing the editable icon, however, I cannot edit with a blocked account. Moving to blocked for now.

image.png (1×720 px, 309 KB)

@ABorbaWMF sorry, staging doesn't auto-update (unless someone tells you they've updated staging assume the code is on the beta cluster). I've updated staging so you can now test there now!. Sorry I updated the column, but hadn't formally handed it over to you. Consider that done now (and hopefully this behaviour will now be obviously fixed)!

Looks good now on Staging. Tried the major browsers/devices