Page MenuHomePhabricator

Not possible to unprotect a protected page in mobile AMC mode.
Closed, ResolvedPublic

Description

Admins on mobile can protect but not unprotect pages in mobile due to an error in the implementation of T231291.

QA

  • Make sure you have rights to protect pages (ask Jon if you need them). (If you don't you will see "You cannot change the protection settings of this page because you do not have permission to edit it" when you visit the page https://en.wikipedia.beta.wmflabs.org/wiki/Main_Page?action=protect)
  • Log in with AMC mode.
  • Click more menu (...)
  • Click protect
  • In the form make sure only admins can edit
  • Click protect button
  • You should be redirected to the page
  • Click dropdown menu
  • An unprotect link should show with an unlock icon.

Developer notes

The offending line is

			$this->permissions->isAllowed( IMinervaPagePermissions::PROTECT ) ?
				$this->build( 'protect', 'lock', 'protect', $actions ) : null

The menu item should be something like:

			$this->permissions->isAllowed( IMinervaPagePermissions::PROTECT ) ?
				(
					array_key_exists( 'unprotect', $actions ) ?
						$this->build( 'unprotect', 'unLock', 'unprotect', $actions ) :
						$this->build( 'protect', 'lock', 'protect', $actions )
				) : null

QA Results - Beta

ACStatusDetails
1T285567#7231574

Event Timeline

ovasileva triaged this task as Medium priority.Jun 29 2021, 2:19 PM

Change 702429 had a related patch set uploaded (by D3r1ck01; author: Derick A):

[mediawiki/skins/MinervaNeue@master] Menu: Add "unprotect" action when current user is an admin

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

Change 702429 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Menu: Add "unprotect" action when current user is an admin

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

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Big Sur
Browser: Chrome
Device: MBP
Emulated Device: NA

Test Artifact(s):

QA Steps

Make sure you have rights to protect pages (ask Jon if you need them). (If you don't you will see "You cannot change the protection settings of this page because you do not have permission to edit it" when you visit the page https://en.wikipedia.beta.wmflabs.org/wiki/Main_Page?action=protect)
Log in with AMC mode.
Click more menu (...)
Click protect
In the form make sure only admins can edit
Click protect button
You should be redirected to the page
Click dropdown menu
✅ AC1: An unprotect link should show with an unlock icon.

Screen Shot 2021-07-22 at 3.24.09 PM.png (1×1 px, 236 KB)

Edtadros subscribed.

Cannot test in prod due to permissions.

Looks good, resolving based on results in beta