Page MenuHomePhabricator

Edit icon should show as locked when user is blocked from editing.
Closed, ResolvedPublic2 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

Actual

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

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

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 27 2018, 3:31 PM
ovasileva triaged this task as Normal priority.Mar 27 2018, 3:52 PM
ovasileva set the point value for this task to 2.Mar 27 2018, 4:32 PM
Niedzielski moved this task from To Do to Doing on the Readers-Web-Kanbanana-Board-Old board.

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

Niedzielski added subscribers: pmiazga, Niedzielski.

@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

Niedzielski removed Niedzielski as the assignee of this task.Apr 5 2018, 2:27 PM

This is related to T190613.

Jdlrobson updated the task description. (Show Details)Apr 5 2018, 7:37 PM

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

@Jdlrobson can you just add a screenshot :) ?

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

Jdlrobson updated the task description. (Show Details)Apr 5 2018, 10:23 PM

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 updated the task description. (Show Details)Apr 5 2018, 10:26 PM
Jdlrobson removed a project: good first bug.

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.

@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

alexhollender closed this task as Resolved.Apr 23 2018, 7:43 PM