Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cockpit-cms-Migrate/Helper/Convert.php
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ public function collectionEntry($entry, array $fields = []) {
unset($entry['_by']);

// set default state to "published"
$entry['_state'] = $entry['_state'] ?? 0;
$entry['_state'] = $entry['_state'] ?? 1;

// TODO: transform assets

Expand Down
35 changes: 33 additions & 2 deletions cockpit-cms-Migrate/Helper/TransformFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,39 @@ public function _boolean(array $field): array {
return $field;
}

public function _image(array $field): array {
$field['type'] = 'asset';
$options = fixToArray($field['options'] ?? []);
$field['opts'] = $options;
return $field;
}

public function _set(array $field): array {
$field['opts'] = fixToArray($field['opts'] ?? []);
$transformedField = $this->convertModelFields($field['options']['fields']);
$field['opts']['fields'] = $transformedField;
return $field;
}

public function _collectionlinkselect(array $field): array {
$field['type'] = 'contentItemLink';

$options = fixToArray($field['options'] ?? []);

$link = $options['link'] ?? null;
$display = $options['display'] ?? null;

$transformedField = [
'link' => $link,
'filter' => null,
'display' => $display ? "\${data.$display}" : null,
];

$field['opts'] = $transformedField;

return $field;
}

public function _select(array $field): array {

$field['type'] = 'select';
Expand Down Expand Up @@ -234,8 +267,6 @@ public function booleanPublishedToState($entry) {
*/
public function galleryToAssetMultiple($entry, $field) {



return $entry;

}
Expand Down
16 changes: 11 additions & 5 deletions cockpit-cms-Migrate/views/v2/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,18 @@
<kiss-container class="kiss-margin-large">

<ul class="kiss-breadcrumbs">
<li><a href="<?=$this->route('/migrate')?>"><?=t('Migrate')?></a></li>
<li><a href="<?= $this->route('/migrate') ?>"><?= t('Migrate') ?></a></li>
</ul>

<a href="<?=$this->route('/migrate/migrate')?>" target="_blank"><?=t('Migrate (dry-run)')?></a>
<p>
<a href="<?= $this->route('/migrate/migrate') ?>" target="_blank"><?= t('Migrate (dry-run)') ?></a>
</p>
<p>
<a href="<?= $this->route('/migrate/migrate/all/write') ?>" target="_blank"><?= t('Migrate') ?></a>
</p>
<p>
<a href="<?= $this->route('/migrate/deleteV1stuff') ?>" target="_blank"><?= t('Delete v1 files') ?></a>
</p>

</kiss-container>

Expand All @@ -20,13 +28,11 @@

<script type="module">

export default {
}
export default {}
</script>
</vue-view>



<?php //$this->start('app-side-panel') ?>


Expand Down