-
Notifications
You must be signed in to change notification settings - Fork 397
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
129 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
Documentation/ApiOverview/ContentElements/_Migration/PluginListTypeToCTypeUpdate.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace MyVendor\MyExtension\Upgrades; | ||
|
||
# composer req linawolf/list-type-migration | ||
use Linawolf\ListTypeMigration\Upgrades\AbstractListTypeToCTypeUpdate; | ||
use TYPO3\CMS\Install\Attribute\UpgradeWizard; | ||
|
||
#[UpgradeWizard('myExtensionPluginListTypeToCTypeUpdate')] | ||
final class PluginListTypeToCTypeUpdate extends AbstractListTypeToCTypeUpdate | ||
{ | ||
|
||
protected function getListTypeToCTypeMapping(): array | ||
{ | ||
return [ | ||
'my_extension_pi1' => 'my_extension_pi1', | ||
'my_extension_pi2' => 'my_extension_newpluginname', | ||
]; | ||
} | ||
|
||
public function getTitle(): string | ||
{ | ||
return 'Migrates my_extension plugins'; | ||
} | ||
|
||
public function getDescription(): string | ||
{ | ||
return 'Migrates my_extension_pi1, my_extension_pi2 from list_type to CType. '; | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
Documentation/ApiOverview/ContentElements/_Migration/_non_extbase_tca.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
$pluginSignature = 'examples_pi1'; | ||
$pluginTitle = 'LLL:EXT:examples/Resources/Private/Language/locallang_db.xlf:tt_content.examples_pi1.title'; | ||
$extensionKey = 'examples'; | ||
$flexFormPath = 'FILE:EXT:examples/Configuration/Flexforms/flexform_ds1.xml'; | ||
|
||
// Add the plugins to the list of plugins | ||
ExtensionManagementUtility::addPlugin( | ||
[$pluginTitle, $pluginSignature, '', 'plugin'], | ||
- 'list_type', | ||
+ 'CType', | ||
$extensionKey, | ||
); | ||
|
||
-// Disable the display of layout and select_key fields for the plugin | ||
-$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist'][$pluginSignature] | ||
- = 'layout,select_key,pages'; | ||
- | ||
-// Activate the display of the plug-in flexform field and set FlexForm definition | ||
-$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist'][$pluginSignature] = 'pi_flexform'; | ||
|
||
+// Activate the display of the FlexForm field | ||
+ExtensionManagementUtility::addToAllTCAtypes( | ||
+ 'tt_content', | ||
+ '--div--;Configuration,pi_flexform,', | ||
+ $pluginSignature, | ||
+ 'after:subheader', | ||
+); | ||
|
||
ExtensionManagementUtility::addPiFlexFormValue( | ||
- $pluginSignature, | ||
+ '*', | ||
$flexFormPath, | ||
+ $pluginSignature, | ||
); |
20 changes: 20 additions & 0 deletions
20
Documentation/ApiOverview/ContentElements/_Migration/_typoscript.diff
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
-tt_content.list.20.examples_pi1 = USER | ||
-tt_content.list.20.examples_pi1 { | ||
+tt_content.examples_pi1 = USER | ||
+tt_content.examples_pi1 { | ||
userFunc = MyVendor\Examples\Controller\ExampleController->example | ||
settings { | ||
singlePid = 42 | ||
listPid = 55 | ||
} | ||
view { | ||
templateRootPath = {$templateRootPath} | ||
partialRootPath = {$partialRootPath} | ||
layoutRootPath = {$layoutRootPath} | ||
} | ||
} | ||
|
||
# Or if you used the plugin top level object: | ||
|
||
-tt_content.list.20.examples_pi1 < plugin.tx_examples_pi1 | ||
+tt_content.examples_pi1 < plugin.tx_examples_pi1 |