Bug #77435
closedIRRE throws exception if related record is deleted
100%
Description
It is not possible to edit a record, which holds IRRE relations to deleted records.
DB-structure is an old one with comma-separated uids in parent record.
Example: ke_search filter, which holds references to filter options.
Deleting a referenced filter option leads to the filter itself not being editable anymore.
DatabaseRecordException with code #1437656081 "Record with uid ... not found"
Updated by Georg Ringer over 8 years ago
The problem can be found here:
https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaInline.php#L322-L326
// For foreign_selector with useCombination $mainChild is the mm record // and $combinationChild is the child-child. For 1:n "normal" relations, // $mainChild is just the normal child record and $combinationChild is empty. $mainChild = $formDataCompiler->compile($formDataCompilerInput); if ($parentConfig['foreign_selector'] && $parentConfig['appearance']['useCombination']) { try { $mainChild['combinationChild'] = $this->compileChildChild($mainChild, $parentConfig); } catch (DatabaseRecordException $e) {
The first call to compile()
must be caught as well. However generating a flash message there is not the full solution because this will then generate errors in \TYPO3\CMS\Backend\Form\Container\InlineRecordContainer::renderForeignRecordHeader
as the required array information is not available.
Updated by Daniel Goerz about 8 years ago
- Sprint Focus set to Stabilization Sprint
Updated by Oliver Hader almost 4 years ago
- Status changed from Accepted to Closed
- Is Regression changed from Yes to No
- Sprint Focus deleted (
Stabilization Sprint)
Probably won't be handled as regression fix after four years
Updated by Markus Klein almost 4 years ago
- Status changed from Closed to Needs Feedback
- Assignee set to Markus Klein
- Target version deleted (
Candidate for patchlevel)
I'm checking the current state again.
Updated by Philipp Kitzberger almost 4 years ago
I can confirm that this error is still present in TYPO3 9 with the following scenario where a model X has a mm-relation to fe_users:
'users' => array( 'label' => 'mm relation to fe_users', 'config' => array( 'type' => 'inline', 'foreign_table' => 'fe_users', 'MM' => 'tx_customext_x_user_mm', 'MM_opposite_field' => 'uid_foreign', 'maxitems' => 9999, 'appearance' => array( 'collapseAll' => 1, 'levelLinksPosition' => 'none', 'showSynchronizationLink' => 1, 'showPossibleLocalizationRecords' => 0, 'showAllLocalizationLink' => 0, ), ), ),
I traced the cause down to https://github.com/TYPO3/TYPO3.CMS/blob/9.5/typo3/sysext/backend/Classes/Form/FormDataProvider/TcaInline.php#L223
protected function resolveRelatedRecords(array $result, $fieldName) { ... if ($result['inlineCompileExistingChildren']) { foreach ($connectedUidsOfDefaultLanguageRecord as $uid) { $compiledChild = $this->compileChild($result, $fieldName, $uid); $result['processedTca']['columns'][$fieldName]['children'][] = $compiledChild; } } return $result; }
A simple try-catch around the two line with $compiledChild
seems to solve this problem. Then the mm record of the deleted user is not been rendered anymore at all.
Updated by Gerrit Code Review almost 4 years ago
- Status changed from Needs Feedback 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/c/Packages/TYPO3.CMS/+/67959
Updated by Gerrit Code Review over 3 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/c/Packages/TYPO3.CMS/+/67959
Updated by Gerrit Code Review over 3 years ago
Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/68532
Updated by Philipp Kitzberger over 3 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset f31ff86cdf84115c6bd9c8c1ac71972487a5536f.