Only show history link in page-actions menu if page exists

Bug: T213352
Change-Id: Ib51c68679426fdf0bd4cc33aeda37decebfd4ace
This commit is contained in:
Jan Drewniak 2019-03-21 12:22:35 +01:00
parent 6ed4d4557c
commit b2607d3a1a
1 changed files with 5 additions and 1 deletions

View File

@ -261,6 +261,10 @@ class SkinMinerva extends SkinTemplate {
&& ( $action === 'talk' || $action === 'switch-language' ) );
}
if ( $action === 'history' && $title->exists() ) {
return $this->getSkinOption( self::OPTIONS_HISTORY_PAGE_ACTIONS );
}
if (
!in_array( $action, $config->get( 'MinervaPageActions' ) )
|| ( $this->getUserPageHelper()->isUserPage() && !$title->exists() )
@ -1160,7 +1164,7 @@ class SkinMinerva extends SkinTemplate {
$menu[] = $this->createWatchPageAction( $actions );
}
if ( $this->getSkinOption( self::OPTIONS_HISTORY_PAGE_ACTIONS ) ) {
if ( $this->isAllowedPageAction( 'history' ) ) {
$menu[] = $this->getHistoryPageAction();
}