|
7 | 7 | use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationExtensionNotConfiguredException;
|
8 | 8 | use TYPO3\CMS\Core\Configuration\Exception\ExtensionConfigurationPathDoesNotExistException;
|
9 | 9 | use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
|
| 10 | +use TYPO3\CMS\Core\Configuration\Features; |
10 | 11 | use TYPO3\CMS\Core\Core\Environment;
|
11 | 12 | use TYPO3\CMS\Core\Utility\ArrayUtility as CoreArrayUtility;
|
12 | 13 | use TYPO3\CMS\Core\Utility\GeneralUtility;
|
@@ -205,19 +206,36 @@ public static function testGdExtension(): void
|
205 | 206 | * Merges Flexform, TypoScript and Extension Manager Settings
|
206 | 207 | * Note: If FF value is empty, we want the TypoScript value instead
|
207 | 208 | *
|
| 209 | + * ToDo v14: Maybe drop this method completely and stick to TYPO3 default behavior ore use the extbase option; |
| 210 | + * see EXT:news -- overrideFlexFormsIfEmpty |
| 211 | + * see Core:Extbase -- ignoreFlexFormSettingsIfEmpty |
| 212 | + * |
208 | 213 | * @param array $settings All settings
|
209 | 214 | * @param string $typoScriptLevel Startpoint
|
210 | 215 | * @return array
|
211 | 216 | */
|
212 | 217 | public static function mergeTypoScript2FlexForm(array $settings, string $typoScriptLevel = 'setup'): array
|
213 | 218 | {
|
| 219 | + $originalSettings = $settings; |
214 | 220 | if (array_key_exists($typoScriptLevel, $settings) && array_key_exists('flexform', $settings)) {
|
215 | 221 | $settings = ArrayUtility::arrayMergeRecursiveOverrule(
|
216 | 222 | (array)$settings[$typoScriptLevel],
|
217 | 223 | (array)$settings['flexform'],
|
218 | 224 | false,
|
219 | 225 | false
|
220 | 226 | );
|
| 227 | + |
| 228 | + // ToDo: remove for TYPO3 v14 compatible version |
| 229 | + // Reason for this part is, the `emptyValuesOverride = true` in the arrayMergeRecursiveOverrule from above |
| 230 | + $features = GeneralUtility::makeInstance(Features::class); |
| 231 | + if ($features->isFeatureEnabled('powermailEditorsAreAllowedToSendAttachments')) { |
| 232 | + if (isset($originalSettings['flexform']['receiver']['attachment'])) { |
| 233 | + $settings['receiver']['attachment'] = $originalSettings['flexform']['receiver']['attachment']; |
| 234 | + } |
| 235 | + if (isset($originalSettings['flexform']['sender']['attachment'])) { |
| 236 | + $settings['sender']['attachment'] = $originalSettings['flexform']['sender']['attachment']; |
| 237 | + } |
| 238 | + } |
221 | 239 | }
|
222 | 240 | return $settings;
|
223 | 241 | }
|
|
0 commit comments