Move the sidebar cache to core

This cache is unnecessary since I reimplemented it in core.

Change-Id: I31e5694bebb3c73b88c11827ff3cd953233269f4
This commit is contained in:
Tim Starling 2022-02-08 14:34:37 +11:00
parent 46303db1cd
commit 0bfcad1b1f

View file

@ -105,7 +105,7 @@ class SkinMinerva extends SkinMustache {
$services = MediaWikiServices::getInstance();
/** @var \MediaWiki\Minerva\Menu\PageActions\PageActionsDirector $pageActionsDirector */
$pageActionsDirector = $services->getService( 'Minerva.Menu.PageActionsDirector' );
$sidebar = $this->buildSidebarCached();
$sidebar = $this->buildSidebar();
$actions = $nav['actions'] ?? [];
return $pageActionsDirector->buildMenu( $sidebar['TOOLBOX'], $actions );
}
@ -163,7 +163,7 @@ class SkinMinerva extends SkinMustache {
'html-minerva-user-notifications' => $this->prepareUserNotificationsButton( $this->getNewtalks() ),
'data-minerva-main-menu' => $this->getMainMenu()->getMenuData(
$nav,
$this->buildSidebarCached()
$this->buildSidebar()
)['items'],
'html-minerva-tagline' => $this->getTaglineHtml(),
'html-minerva-post-heading' => $this->isTalkPageWithViewAction()
@ -785,17 +785,6 @@ class SkinMinerva extends SkinMustache {
return $buttons;
}
/**
* Minerva skin do not have sidebar, there is no need to calculate that.
* @return array
*/
private function buildSidebarCached() {
if ( !$this->sidebarCachedResult ) {
$this->sidebarCachedResult = $this->buildSidebar();
}
return $this->sidebarCachedResult;
}
/**
* @inheritDoc
* @return array