Merge "Fix history link"

This commit is contained in:
jenkins-bot 2021-11-29 23:36:42 +00:00 committed by Gerrit Code Review
commit f4b3b11053

View file

@ -439,6 +439,10 @@ class SkinMinerva extends SkinMustache {
->getRevisionLookup()
->getTimestampFromId( $out->getRevisionId() );
}
// Create history link and corresponding icons.
$historyLinkAndIcons = [];
if ( Action::getActionName( RequestContext::getMain() ) === 'view' ) {
$historyIconClasses = [
'historyIconClass' => MinervaUI::iconClass(
'history-base20', 'mw-ui-icon-small', '', 'wikimedia'
@ -459,9 +463,12 @@ class SkinMinerva extends SkinMustache {
$this->getGenericHistoryLink( $title ) :
$this->getRelativeHistoryLink( $title, $timestamp );
$historyLinkAndIcons = $historyLink + $historyIconClasses;
}
$title = $this->getTitle();
return $title->canExist() && $title->exists()
? $historyLink + $historyIconClasses
return $title->canExist() && $title->exists() && !empty( $historyLinkAndIcons )
? $historyLinkAndIcons
: null;
}