Prefer local data to parent data
The + operator will drop any existing keys. The data from Vector should have precedence as the data coming from core may be in a different format. Noticed while upstreaming data for footer. Change-Id: Icc772733577e0b165acdbc8a9b6143bd5410c33a
This commit is contained in:
parent
c9645fe691
commit
4dbe4076d6
|
@ -129,7 +129,9 @@ class SkinVector extends SkinMustache {
|
|||
|
||||
$isSearchInHeader = $featureManager->isFeatureEnabled( Constants::FEATURE_SEARCH_IN_HEADER );
|
||||
|
||||
$commonSkinData = parent::getTemplateData() + [
|
||||
$parentData = parent::getTemplateData();
|
||||
|
||||
$commonSkinData = array_merge( [
|
||||
'page-langcode' => $title->getPageViewLanguage()->getHtmlCode(),
|
||||
'page-isarticle' => (bool)$out->isArticle(),
|
||||
|
||||
|
@ -148,7 +150,7 @@ class SkinVector extends SkinMustache {
|
|||
|
||||
'data-sidebar' => $this->getTemplateDataSidebar(),
|
||||
'sidebar-visible' => $this->isSidebarVisible(),
|
||||
] + $this->getMenuProps();
|
||||
], $parentData, $this->getMenuProps() );
|
||||
|
||||
if ( $skin->getUser()->isLoggedIn() ) {
|
||||
// Note: This data is also passed to legacy template where it is unused.
|
||||
|
|
Loading…
Reference in New Issue