Bug #92483
closedTCA-column-flex-ds : The file definition with EXT: won't work
100%
Description
The following-column-example will produce the error `Data Structure ERROR: No [\'ROOT\'][\'el\'] element found in flex form definition.';`. because the file is not resolved.
'tx_timer_timer' => [ 'exclude' => true, 'label' => 'LLL:EXT:timer/Resources/Private/Language/locallang_db.xlf:tx_timer_general.field.tx_timer_timer', 'config' => [ 'type' => 'flex', 'ds_pointerField' => 'tx_timer_selector', 'ds' => [ 'default' => 'EXT:timer/Configuration/FlexForms/TimerDef/Default.xml', 'porthDaily' => 'EXT:timer/Configuration/FlexForms/TimerDef/DailyTimer.xml', 'porthYearly' => 'EXT:timer/Configuration/FlexForms/TimerDef/YearlyTimer.xml' ], ], ],
In the comment of `parseDataStructureByIdentifier` in TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools is written:
* After the data structure definition is found, the method resolves: * * FILE:EXT: prefix of the data structure itself - the ds is in a file * * FILE:EXT: prefix for sheets - if single sheets are in files * * EXT: prefix for sheets - if single sheets are in files (slightly different b/w compat syntax) * * Create an sDEF sheet if the data structure has non, yet.
But the method fulfill it not.
Extend in the middle of the method the code, to fix the problem.
// Resolve FILE: prefix pointing to a DS in a file if (strpos(trim($dataStructure), 'FILE:') === 0) { $file = GeneralUtility::getFileAbsFileName(substr(trim($dataStructure), 5)); if (empty($file) || !@is_file($file)) { throw new \RuntimeException( 'Data structure file ' . $file . ' could not be resolved to an existing file', 1478105826 ); } $dataStructure = file_get_contents($file); // } beginn of additional code in Line 692 } else if (strpos(trim($dataStructure), 'EXT:') === 0) { $file = GeneralUtility::getFileAbsFileName(substr(trim($dataStructure), 0)); if (empty($file) || !@is_file($file)) { throw new \RuntimeException( 'Data structure file ' . $file . ' could not be resolved to an existing file', 1478105826 ); } $dataStructure = file_get_contents($file); } // End of additional code
Updated by Dieter Porth about 4 years ago
- Subject changed from TCA. flex- to TCA-column-flex-ds The file definieion EXT: won't work
The following-column-example will produce the error `Data Structure ERROR: No [\'ROOT\'][\'el\'] element found in flex form definition.';`. because the file is not resolved.
'tx_timer_timer' => [ 'exclude' => true, 'label' => 'LLL:EXT:timer/Resources/Private/Language/locallang_db.xlf:tx_timer_general.field.tx_timer_timer', 'config' => [ 'type' => 'flex', 'ds_pointerField' => 'tx_timer_selector', 'ds' => [ 'default' => 'EXT:timer/Configuration/FlexForms/TimerDef/Default.xml', 'porthDaily' => 'EXT:timer/Configuration/FlexForms/TimerDef/DailyTimer.xml', 'porthYearly' => 'EXT:timer/Configuration/FlexForms/TimerDef/YearlyTimer.xml' ], ], ],
In the comment of `parseDataStructureByIdentifier` in TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools is written:
* After the data structure definition is found, the method resolves: * * FILE:EXT: prefix of the data structure itself - the ds is in a file * * FILE:EXT: prefix for sheets - if single sheets are in files * * EXT: prefix for sheets - if single sheets are in files (slightly different b/w compat syntax) * * Create an sDEF sheet if the data structure has non, yet.
But the method fullfill it not.
Extend in middle of the method `TYPO3\CMS\Core\Configuration\FlexForm\FlexFormTools->parseDataStructureByIdentifier`(line 692ff) the code to fix the problem.
@
// Resolve FILE: prefix pointing to a DS in a file
if (strpos(trim($dataStructure), 'FILE:') === 0) {
$file = GeneralUtility::getFileAbsFileName(substr(trim($dataStructure), 5));
if (empty($file) || !is_file($file)) {
throw new \RuntimeException(
'Data structure file ' . $file . ' could not be resolved to an existing file',
1478105826
);
}
$dataStructure = file_get_contents($file);
// } beginn of additional code in Line 692
} else if (strpos(trim($dataStructure), 'EXT:') === 0) {
$file = GeneralUtility::getFileAbsFileName(substr(trim($dataStructure), 0));
if (empty($file) || !@is_file($file)) {
throw new \RuntimeException(
'Data structure file ' . $file . ' could not be resolved to an existing file',
1478105826
);
}
$dataStructure = file_get_contents($file);
} // End of additional code
Updated by Dieter Porth about 4 years ago
- Subject changed from TCA-column-flex-ds The file definieion EXT: won't work to TCA-column-flex-ds : The file definition with EXT: won't work
Updated by Simon Schaufelberger over 2 years ago
- Status changed from New to Accepted
- Complexity set to easy
Updated by Gerrit Code Review over 2 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/74441
Updated by Gerrit Code Review over 2 years ago
Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/74441
Updated by Gerrit Code Review over 2 years ago
Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/74441
Updated by Gerrit Code Review over 2 years ago
Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/74441
Updated by Gerrit Code Review over 2 years ago
Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/74441
Updated by Gerrit Code Review over 2 years ago
Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/74462
Updated by Anonymous over 2 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset c9fecd6236d340fc8c34a2f3f9f564cbecb18aa5.