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
1 change: 1 addition & 0 deletions Classes/Utility/MigrationUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ protected function copyTemplate(array $dceConfiguration, LoadedContentBlock $con
}

if ($templateContent) {
$templateContent = str_replace('field.', 'data.', $templateContent);
GeneralUtility::writeFile(GeneralUtility::getFileAbsFileName($contentBlock->getExtPath() . '/' . $contentBlock->getPackage() . '/' . ContentBlockPathUtility::getFrontendTemplatePath()), $templateContent);
}
}
Expand Down
8 changes: 6 additions & 2 deletions Classes/Utility/UpgradeUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ public function migrateContentElements(Result $result, array $migrationInstructi
foreach ($dceFields as $dceField) {
$oldField = $dceField['variable'];
$migrationInstruction = $migrationInstructions['fields'][$oldField] ?? [];
$newFieldName = $migrationInstruction['fieldName'] ?? $oldField;
if ($migrationInstruction['fieldName']) {
$newFieldName = $migrationInstruction['fieldName'];
} else {
$newFieldName = $dceField['map_to'] !== '' ? $dceField['map_to'] : UniqueIdentifierCreator::createContentTypeIdentifier($migrationInstructions['vendor'] . '/' . $migrationInstructions['identifier']) . '_' . $oldField;
}

if (($migrationInstruction['skip'] ?? false) || (int) $dceField['type'] === 1) {
continue;
Expand Down Expand Up @@ -232,7 +236,7 @@ protected function addDataForField(array &$data, array $record, string $oldField
'identifier' => [
'uid_foreign' => $record['uid'],
'tablenames' => $record['tableName'] ?? 'tt_content',
'fieldname' => 'settings.' . $oldFieldName,
'fieldname' => $oldFieldName,
]
]
],
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Minimal Configuration
*<sitepackage>/Configuration/DceMigration.php*
```php
<?php


/**
* @var \TYPO3\CMS\Core\Package\PackageManager $packageManager
*/
$packageManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Package\PackageManager::class);
$package = $packageManager->getPackage('<sitepackage>');

return [
'<DCE IDENTIFIER>' => [
'vendor' => '<VENDOR>',
'identifier' => '<CONTENT BLOCKS IDENTIFIER>',
'package' => $package,
],
// ... your dce_elements
];

```