diff --git a/Classes/Updates/SwitchableControllerActionsPluginUpdater.php b/Classes/Updates/SwitchableControllerActionsPluginUpdater.php index 5928549..045688f 100644 --- a/Classes/Updates/SwitchableControllerActionsPluginUpdater.php +++ b/Classes/Updates/SwitchableControllerActionsPluginUpdater.php @@ -101,14 +101,11 @@ public function performMigration(): bool $record['list_type'], $flexForm['switchableControllerActions'] ); - $allowedSettings = $this->getAllowedSettingsFromFlexForm($targetListType); // Remove flexform data which do not exist in flexform of new plugin foreach ($flexFormData['data'] as $sheetKey => $sheetData) { - foreach ($sheetData['lDEF'] as $settingName => $setting) { - if (!in_array($settingName, $allowedSettings, true)) { - unset($flexFormData['data'][$sheetKey]['lDEF'][$settingName]); - } + if (isset($sheetData['lDEF']['switchableControllerActions'])) { + unset($flexFormData['data'][$sheetKey]['lDEF']['switchableControllerActions']); } // Remove empty sheets @@ -163,27 +160,6 @@ protected function getTargetListType(string $sourceListType, string $switchableC return ''; } - protected function getAllowedSettingsFromFlexForm(string $listType): array - { - if (isset($GLOBALS['TCA']['tt_content']['columns']['pi_flexform']['config']['ds'][$listType . ',list']) === false) { - return []; - } - - $flexFormFile = $GLOBALS['TCA']['tt_content']['columns']['pi_flexform']['config']['ds'][$listType . ',list']; - $flexFormContent = file_get_contents(GeneralUtility::getFileAbsFileName(substr(trim((string)$flexFormFile), 5))); - $flexFormData = GeneralUtility::xml2array($flexFormContent); - - // Iterate each sheet and extract all settings - $settings = []; - foreach ($flexFormData['sheets'] as $sheet) { - foreach ($sheet['ROOT']['el'] as $setting => $tceForms) { - $settings[] = $setting; - } - } - - return $settings; - } - /** * Updates list_type and pi_flexform of the given content element UID *