mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-24 14:23:53 +00:00
Improve Community Main Menu element handling
The Commmunity Portal main menu element should be handled same way as Skin::buildSideBar() does: - it should ignore "-" -> this is how editors disable the link - it should use inContentLanguage() to properly support different languages Bug: T216152 Change-Id: I41b2373fd1b55d9d4beaba60eeb362e6188d24de
This commit is contained in:
parent
440e725030
commit
0ef74abc2d
|
@ -22,6 +22,7 @@ namespace MediaWiki\Minerva\Menu;
|
|||
|
||||
use IContextSource;
|
||||
use MediaWiki\Special\SpecialPageFactory;
|
||||
use Message;
|
||||
use MinervaUI;
|
||||
use MWException;
|
||||
use SpecialMobileWatchlist;
|
||||
|
@ -298,8 +299,13 @@ final class Definitions {
|
|||
* @throws MWException
|
||||
*/
|
||||
public function insertCommunityPortal( Group $group ) {
|
||||
$titleName = \MessageCache::singleton()->get( 'Portal-url' );
|
||||
if ( !$titleName || \Http::isValidURI( $titleName ) ) {
|
||||
$message = new Message( 'Portal-url' );
|
||||
if ( !$message->exists() ) {
|
||||
return;
|
||||
}
|
||||
$inContentLang = $message->inContentLanguage();
|
||||
$titleName = $inContentLang->plain();
|
||||
if ( $inContentLang->isDisabled() || \Http::isValidURI( $titleName ) ) {
|
||||
return;
|
||||
}
|
||||
$title = Title::newFromText( $titleName );
|
||||
|
|
Loading…
Reference in a new issue