Skip to content

Commit 8b93dfd

Browse files
committed
[Fix]
There is an error with Page imports by YAML files without page id And the exported YAML was JSON instead.
1 parent fd709ed commit 8b93dfd

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

config/pimcore/config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ neusta_converter:
1313
properties:
1414
id:
1515
source: id
16+
skip_null: true
1617
default: 0
1718
key: ~
1819
title:

src/Documents/Export/PageExporter.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ public function toYaml(Page $page): string
3232
return $this->serializer->serialize(
3333
[self::PAGE => $yamlExportPage],
3434
'yaml',
35-
['yaml_inline' => 4, 'yaml_indent' => 4, 'yaml_flags' => self::YAML_DUMP_FLAGS],
35+
[
36+
'yaml_inline' => 4, // bis zu welcher Ebene des Array/Objekts soll YAML erzeugt werden
37+
'yaml_indent' => 0, // Wieviel Einrückung soll das YAML initial kriegen?
38+
'yaml_flags' => self::YAML_DUMP_FLAGS
39+
]
3640
);
3741
}
3842
}

src/Documents/Export/YamlExportPage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class YamlExportPage
66
{
7-
public int $id;
7+
public ?int $id = null;
88
public int $parentId;
99
public string $type = 'page';
1010
public bool $published = false;

0 commit comments

Comments
 (0)