Skip to content

Commit

Permalink
CIF: fix importing/exporting skeleton site types
Browse files Browse the repository at this point in the history
  • Loading branch information
mlocati committed Nov 24, 2023
1 parent 00cefc1 commit 347c64d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function import(\SimpleXMLElement $sx)

$importer = new ContentImporter();
$importer->setHomePage($home);
$importer->importXml($type->skeleton->locale);
$importer->importXml($localeNode);

}

Expand Down
20 changes: 10 additions & 10 deletions concrete/src/Export/Item/SiteType.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,28 +95,28 @@ public function export($type, \SimpleXMLElement $xml)
/**
* @var $locale SkeletonLocale
*/
$exporter = new Exporter();

$localeExporter = $locale->getExporter();
$skeletonLocalesNode = $localeExporter->export($locale, $skeletonNode);
$skeletonPagesNode = $skeletonLocalesNode->addChild('pages');
$skeletonLocaleNode = $localeExporter->export($locale, $skeletonNode);

$list = new PageList();
$list->setSiteTreeObject($locale->getSiteTree());
$list->ignorePermissions();
$list->sortByDisplayOrder();
$pages = $list->getResults();

$exporter = new Exporter();

foreach($pages as $page) {
$exporter->export($page, $skeletonPagesNode);
if ($pages !== []) {
$skeletonPagesNode = $skeletonLocaleNode->addChild('pages');
foreach($pages as $page) {
$exporter->export($page, $skeletonPagesNode);
}
}

$stackList = new StackList();
$stackList->setSiteTreeObject($locale->getSiteTree());
$stacks = $stackList->getResults();

if (count($stacks)) {
$skeletonStacksNode = $skeletonNode->addChild('stacks');
if ($stacks !== []) {
$skeletonStacksNode = $skeletonLocaleNode->addChild('stacks');
foreach($stacks as $stack) {
$exporter->export($stack, $skeletonStacksNode);
}
Expand Down

0 comments on commit 347c64d

Please sign in to comment.