Bug #82104
closedIRRE + GROUP with real MM relations not working (fatal error)
100%
Description
See /typo3/sysext/backend/Classes/Form/Container/InlineControlContainer.php line 189:
if ($type === 'select') {
// A resolved select field is an array - take first value
$value = $value['0'];
} else {
// A group field is still a list with pipe separated uid|tableName
$valueParts = GeneralUtility::trimExplode('|', $value);
$itemParts = explode('_', $valueParts[0]);
$value = [
'uid' => array_pop($itemParts),
'table' => implode('_', $itemParts)
];
}
// @todo: This is weird, $value has different structure for group and select fields?
$uniqueIds[$child['databaseRow']['uid']] = $value;
The ToDo says it all. ;-)
When not using a SELECT but a GROUP, this functions assumes the value is a string with a pipe for uid / tablename. However, when using real MM relations, $value contains an array with the uid and tablenames. This results in a fatal error:
#1476107295: PHP Warning: explode() expects parameter 2 to be string, array given in /vendor/typo3/cms/typo3/sysext/core/Classes/Utility/GeneralUtility.php line 1297 (More information)
Files
Updated by Ronald Kools over 7 years ago
This error occurs when using an IRRE with 'foreign_unique'.
Updated by Tymoteusz Motylewski about 6 years ago
- Category changed from Extbase to FormEngine aka TCEforms
changed category to the correct one
Updated by Cyril Janody about 6 years ago
Hi all,
Just add a sample extension.
Simply create one or more obj1, obj2 and link them.
Will push a fix soon.
Updated by Gerrit Code Review about 6 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58421
Updated by Gerrit Code Review about 6 years ago
Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58422
Updated by Tymoteusz Motylewski about 6 years ago
Cyril,
Can you please do a pull request with your example to the Styleguide extenstion ?https://github.com/TYPO3/styleguide
This will make sure that its easier for everybody to test, and in the future we can test this case with never TYPO3 versions.
Please let me know if you have any questions.
Updated by Gerrit Code Review about 6 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58421
Updated by Cyril Janody about 6 years ago
Hi Timoteusz,
Pull request https://github.com/TYPO3/styleguide/pull/121
Thank you
Updated by Christian Kuhn about 6 years ago
- Related to Bug #84735: InlineControlContainer wrongly assumes group field values are still a string added
Updated by Gerrit Code Review about 6 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58421
Updated by Gerrit Code Review about 6 years ago
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58421
Updated by Cyril Janody about 6 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset db3a3ccc7098ea318fba4942ba42ac62d5298206.
Updated by Gerrit Code Review about 6 years ago
- Status changed from Resolved to Under Review
Patch set 3 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/58422
Updated by Cyril Janody about 6 years ago
- Status changed from Under Review to Resolved
Applied in changeset f4102ffe6a21377ad00ca028fccf170a2760a2b7.