Page MenuHomePhabricator

Not possible to move, delete and protect a user page on mobile AMC page
Closed, ResolvedPublic

Description

When I visit https://en.m.wikipedia.org/wiki/User:Manaswi_Srivastava as an admin, logged into the "Advanced editor mode" on https://en.m.wikipedia.org/w/index.php?title=Special:MobileOptions I do not see an option to delete, move or protect the user page.

Screen Shot 2021-05-24 at 3.10.23 PM.png (1×1 px, 280 KB)

Expected

  • Delete icon shows if I am an admin
  • Delete icon doesn't show if I am not an admin (or anonymous)

Event Timeline

ovasileva triaged this task as Medium priority.May 25 2021, 10:14 AM
ovasileva moved this task from Incoming to Triaged but Future on the Readers-Web-Backlog board.

Just noticed this as well. Additionally, for pages in the Help and Template namespace, I do not see a “protect” option (while move and delete are present). I can’t think of a good reason to treat the various namespaces differently.

Just noticed this as well. Additionally, for pages in the Help and Template namespace, I do not see a “protect” option (while move and delete are present). I can’t think of a good reason to treat the various namespaces differently.

I see protect on template namespace but not on this help page, so I'm not 100% sure what's going on there as the logic seems pretty sound:

image.png (1×2 px, 230 KB)

Screen Shot 2021-06-24 at 8.01.33 AM.png (820×2 px, 345 KB)

I wonder if what's happening is that the protect icon is only showing for unprotected pages and this is a bug for all pages? If so, probably worth a new Phabricator ticket.

The issue with user pages is simply they use a different menu from other pages (because of the user specific menus) and it was understandably overlooked in implementation. It was not a conscious decision.

Oh, true, I checked with protected pages in ns-0 as well! Okay, new task then.

@Jdlrobson, per T231291: AMC mode: No link to delete or move, protect and other admin and non-admin actions in Minerva, seems this has been resolved? I can't seem to reproduce on master for core, MobileFrontend (master) and MinervNeue (master).

Correct me if I'm wrong but this is what I see locally ATM

Screen Shot 2021-06-24 at 5.37.42 PM.png (1×2 px, 217 KB)

@Jdlrobson, per T231291: AMC mode: No link to delete or move, protect and other admin and non-admin actions in Minerva, seems this has been resolved? I can't seem to reproduce on master for core, MobileFrontend (master) and MinervNeue (master).

Correct me if I'm wrong but this is what I see locally ATM

Screen Shot 2021-06-24 at 5.37.42 PM.png (1×2 px, 217 KB)

If you protect that page, "Allow only administrators" to edit, the protect button disappears -so there is no way to unprotect.

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

Have opened T285567 for this unrelated issue.

@Jdlrobson, thanks for reporting the new issue. I've proposed a patch to fix it.

Now, coming back to this issue, I've tested again. The second point that is expected is the actual. Delete action is not shown when I'm not admin but since I'm not admin, I can't test.

Screen Shot 2021-06-30 at 6.40.55 PM.png (1×2 px, 310 KB)

I'll try to see if I can reproduce this locally.

GPR added a subscriber: GPR.

Looks like the option to delete, move or protect not appear only in user page. They are appeared in regular page when logged in as admin.

I'll investigate more and try to fix it.

After some investigation, looks like user page is using different kind of overflow menu. It is using UserNamespaceOverflowBuilder that doesn't have delete, move and protect options. The rest of the page is using DefaultOverflowBuilder.

Should I just copy some code from DefaultOverflowBuilder to UserNamespaceOverflowBuilder to show delete, move and protect options?

Yes copying over here would be fine for now.

Change 737159 had a related patch set uploaded (by GPR; author: GPR):

[mediawiki/skins/MinervaNeue@master] Add move, delete, and protect options on mobile AMC user page

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

Change 737159 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Add move, delete, and protect options on mobile AMC user page

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

Tested on beta cluster:

Screen Shot 2021-11-08 at 1.49.02 PM.png (1×2 px, 300 KB)

Screen Shot 2021-11-08 at 1.50.28 PM.png (1×2 px, 269 KB)

Will check again on Wednesday in production setting.

LGTM! Thanks for working on this!

Screen Shot 2021-11-12 at 2.30.12 PM.png (1×2 px, 189 KB)