Merge "Fixes missing account login in OfficeWiki"

This commit is contained in:
jenkins-bot 2023-03-09 21:58:38 +00:00 committed by Gerrit Code Review
commit ba00ff199f
2 changed files with 19 additions and 7 deletions

View file

@ -289,13 +289,17 @@ class Hooks implements
if ( !$isRegistered ) { if ( !$isRegistered ) {
// Remove "Not logged in" from personal menu dropdown for anon users. // Remove "Not logged in" from personal menu dropdown for anon users.
unset( $content_navigation['user-menu']['anonuserpage'] ); unset( $content_navigation['user-menu']['anonuserpage'] );
// Remove duplicate "Login" link added by SkinTemplate::buildPersonalUrls if group read permissions
// are set to false.
unset( $content_navigation['user-menu']['login-private'] );
// Make login and create account collapsible // Make login and create account collapsible
$content_navigation['user-menu']['login']['collapsible'] = true; if ( isset( $content_navigation['user-menu']['login'] ) ) {
$content_navigation['user-menu']['createaccount']['collapsible'] = true; $content_navigation['user-menu']['login']['collapsible'] = true;
}
if ( isset( $content_navigation['user-menu']['login-private'] ) ) {
$content_navigation['user-menu']['login-private']['collapsible'] = true;
}
if ( isset( $content_navigation['user-menu']['createaccount'] ) ) {
$content_navigation['user-menu']['createaccount']['collapsible'] = true;
}
// Anon editor links handled manually in new anon editor menu // Anon editor links handled manually in new anon editor menu
$anonEditorMenu = []; $anonEditorMenu = [];
@ -398,6 +402,15 @@ class Hooks implements
'icon' => '', 'icon' => '',
] ); ] );
} }
if ( isset( $content_navigation['user-menu']['login-private'] ) ) {
$content_navigation[$overflow]['login-private'] = array_merge(
$content_navigation['user-menu']['login-private'], [
'id' => 'pt-login-private-2',
'collapsible' => true,
// Remove icon
'icon' => '',
] );
}
self::updateMenuItems( $content_navigation, $overflow ); self::updateMenuItems( $content_navigation, $overflow );
} }

View file

@ -507,7 +507,6 @@ class VectorHooksTest extends MediaWikiIntegrationTestCase {
'anonuserpage' => [ 'class' => [], 'icon' => 'anonuserpage' ], 'anonuserpage' => [ 'class' => [], 'icon' => 'anonuserpage' ],
'createaccount' => [ 'class' => [], 'icon' => 'createaccount' ], 'createaccount' => [ 'class' => [], 'icon' => 'createaccount' ],
'login' => [ 'class' => [], 'icon' => 'login' ], 'login' => [ 'class' => [], 'icon' => 'login' ],
'login-private' => [ 'class' => [], 'icon' => 'login-private' ],
'anontalk' => [ 'class' => [], 'icon' => 'anontalk' ], 'anontalk' => [ 'class' => [], 'icon' => 'anontalk' ],
'anoncontribs' => [ 'class' => [], 'icon' => 'anoncontribs' ], 'anoncontribs' => [ 'class' => [], 'icon' => 'anoncontribs' ],
], ],
@ -517,7 +516,7 @@ class VectorHooksTest extends MediaWikiIntegrationTestCase {
count( $contentAnon['user-menu'] ) === 2 && count( $contentAnon['user-menu'] ) === 2 &&
isset( $contentAnon['user-menu']['createaccount'] ) && isset( $contentAnon['user-menu']['createaccount'] ) &&
isset( $contentAnon['user-menu']['login'] ), isset( $contentAnon['user-menu']['login'] ),
'Anon user page, login private and anon talk, anon contribs links are removed from user-menu' 'Anon user page, anon talk, anon contribs links are removed from user-menu'
); );
$this->assertTrue( $this->assertTrue(