Page MenuHomePhabricator

Don't flat-out hide *all* checkboxes on Special:CreateAccount when you only want to hide the "keep me logged in" checkbox
Closed, ResolvedPublic

Description

Turns out Minerva has this "fun" LESS rule in its skinStyles/mediawiki.special.userlogin.common.styles/minerva.less file:

// Hide keep me logged in checkbox on mobile. It will be marked as checked by default.
#userloginForm {
	.mw-htmlform-field-HTMLCheckField {
		display: none;
	}
}

This works fine as long as extensions don't add any checkboxes, and if they do, at least they don't add any mandatory checkboxes. Coincidentally, the NewSignupPage extension does just that: it adds a mandatory checkbox that users must manually check in order to be allowed to register. Since the LESS code hides the extension-created checkbox, it essentially breaks mobile signups completely, forcing users to use the desktop version in order to sign up.

Reported on ShoutWiki as osTicket #3583.

cc @Jdlrobson @matmarex

Event Timeline

You could probably add a more specific CSS class to that element, and then hide based on that class in Minerva.

The form is defined here: https://github.com/wikimedia/mediawiki/blob/master/includes/specialpage/LoginSignupSpecialPage.php#L917

I think you can add a cssclass there, like linkcontainer below already has. (The mw-userlogin-help class used there is actually also used by Minerva to hide that field.)

Change 583294 had a related patch set uploaded (by Jack Phoenix; owner: Jack Phoenix):
[mediawiki/core@master] Give the "remember me" checkbox on Special:UserLogin a CSS class that allows skins like Minerva to hide only the container element of that checkbox instead of all checkboxes

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

Change 583296 had a related patch set uploaded (by Jack Phoenix; owner: Jack Phoenix):
[mediawiki/skins/MinervaNeue@master] Only hide the "remember me" checkbox instead of all (incl. extension-added) checkboxes on Special:UserLogin

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

Change 583294 merged by jenkins-bot:
[mediawiki/core@master] Give the "remember me" checkbox on Special:UserLogin a CSS class that allows skins like Minerva to hide only the container element of that checkbox instead of all checkboxes

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

Jdlrobson claimed this task.

Thanks for taking care of this.

Change 583296 merged by jenkins-bot:
[mediawiki/skins/MinervaNeue@master] Only hide the "remember me" checkbox instead of all (incl. extension-added) checkboxes on Special:UserLogin

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

Change 608240 had a related patch set uploaded (by Lewis Cawte; owner: Jack Phoenix):
[mediawiki/core@REL1_34] Give the "remember me" checkbox on Special:UserLogin a CSS class that allows skins like Minerva to hide only the container element of that checkbox instead of all checkboxes

https://gerrit.wikimedia.org/r/c/mediawiki/core/ /608240

Change 608241 had a related patch set uploaded (by Lewis Cawte; owner: Jack Phoenix):
[mediawiki/skins/MinervaNeue@REL1_34] Only hide the "remember me" checkbox instead of all (incl. extension-added) checkboxes on Special:UserLogin

https://gerrit.wikimedia.org/r/c/mediawiki/skins/MinervaNeue/ /608241

Change 608240 merged by jenkins-bot:
[mediawiki/core@REL1_34] Give the "remember me" checkbox on Special:UserLogin a CSS class that allows skins like Minerva to hide only the container element of that checkbox instead of all checkboxes

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

Change 608241 merged by jenkins-bot:
[mediawiki/skins/MinervaNeue@REL1_34] Only hide the "remember me" checkbox instead of all (incl. extension-added) checkboxes on Special:UserLogin

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