Skip to content

Commit

Permalink
Fix current section lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
uldisrudzitis committed Mar 31, 2020
1 parent 1619f1a commit 126c2e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions _api_app/app/Sites/Sections/SectionsMenuRenderService.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ private function getViewData()
return;
}

$currentSectionOrder = array_search($this->sectionSlug, array_column($sections, 'name'));
$currentSection = $sections[$currentSectionOrder];
$currentSectionOrder = array_search($this->sectionSlug, array_column($this->sections, 'name'));
$currentSection = $this->sections[$currentSectionOrder];
$currentSectionType = isset($currentSection['@attributes']['type']) ? $currentSection['@attributes']['type'] : null;
$isResponsiveTemplate = isset($this->siteTemplateSettings['pageLayout']['responsive']) && $this->siteTemplateSettings['pageLayout']['responsive'] == 'yes';
$this->isResponsive = $currentSectionType == 'portfolio' || $isResponsiveTemplate;
Expand Down
6 changes: 3 additions & 3 deletions _api_app/app/Sites/SitesHeaderRenderService.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ private function getViewData()
}
}

if (!empty($sections)) {
$currentSectionOrder = array_search($this->sectionSlug, array_column($sections, 'name'));
$currentSection = $sections[$currentSectionOrder];
if (!empty($this->sections)) {
$currentSectionOrder = array_search($this->sectionSlug, array_column($this->sections, 'name'));
$currentSection = $this->sections[$currentSectionOrder];
$currentSectionType = isset($currentSection['@attributes']['type']) ? $currentSection['@attributes']['type'] : null;
}

Expand Down

0 comments on commit 126c2e0

Please sign in to comment.