Skip to content

Commit

Permalink
Do not preserve filtered array keys
Browse files Browse the repository at this point in the history
  • Loading branch information
uldisrudzitis committed Feb 21, 2020
1 parent 6fadb59 commit e2857ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions _api_app/app/Sites/Sections/SiteSectionsDataService.php
Original file line number Diff line number Diff line change
Expand Up @@ -738,14 +738,14 @@ public function mergeSiteSections($src_root)
$currentSiteSections = $this->get();

// filter and delete `demo` sections
$currentSiteSections = array_filter($currentSiteSections, function($section) {
$currentSiteSections = array_values(array_filter($currentSiteSections, function($section) {
$isDemo = isset($section['@attributes']['demo']) && $section['@attributes']['demo'];
if ($isDemo) {
$this->delete($section['name']);
}

return !$isDemo;
});
}));

$siteSectionsDS = new self('', $src_root);
$themeSiteSections = array_reverse($siteSectionsDS->get());
Expand Down

0 comments on commit e2857ea

Please sign in to comment.