Commit 5e205b5b authored by Mathias Schreiber's avatar Mathias Schreiber Committed by Frank Nägler
Browse files

[BUGFIX] FormEngine: Fix "Allowed excludefields" settings from FlexForm

Creates an own section in usergroup settings for each plugin with
exclude-Tag in at least one field in XML flexform.
Shows the correct label for each field in this section.

Resolves: #40342
Releases: master
Change-Id: I95c969281c689e7502506f5d358cfc06b4324cfb
Reviewed-on: https://review.typo3.org/43308

Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Frank Nägler's avatarFrank Nägler <frank.naegler@typo3.org>
Tested-by: Frank Nägler's avatarFrank Nägler <frank.naegler@typo3.org>
parent 0994726b
......@@ -175,17 +175,16 @@ class TcaFlexProcess implements FormDataProviderInterface
if (strpos($userNonExcludeField, $excludeFieldsPrefix) !== false) {
$exploded = explode(';', $userNonExcludeField);
$sheetName = $exploded[2];
$fieldName = $exploded[3];
$nonExcludeFields[$sheetName] = $fieldName;
$allowedFlexFieldName = $exploded[3];
$nonExcludeFields[$sheetName][$allowedFlexFieldName] = true;
}
}
foreach ($dataStructure['sheets'] as $sheetName => $sheetDefinition) {
if (!isset($sheetDefinition['ROOT']['el']) || !is_array($sheetDefinition['ROOT']['el'])) {
continue;
}
foreach ($sheetDefinition['ROOT']['el'] as $flexFieldName => $fieldDefinition) {
if (!empty($fieldDefinition['exclude']) && empty($nonExcludeFields[$sheetName])) {
if (!empty($fieldDefinition['exclude']) && !isset($nonExcludeFields[$sheetName][$flexFieldName])) {
unset($result['processedTca']['columns'][$fieldName]['config']['ds']['sheets'][$sheetName]['ROOT']['el'][$flexFieldName]);
}
}
......
......@@ -584,13 +584,13 @@ class TcaSelectItemsTest extends UnitTestCase
$expectedItems = [
0 => [
0 => 'fooTableTitle',
0 => 'fooTableTitle aFlexFieldTitle dummy',
1 => '--div--',
2 => 'default-not-found',
3 => null,
],
1 => [
0 => '(input1)',
0 => 'flexInputLabel (input1)',
1 => 'fooTable:aFlexField;dummy;sDEF;input1',
2 => 'empty-empty',
3 => null,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment