Bug #76138
openInline Relations - Delete Behaviour with mixed Usage of the Deleted Flag
0%
Description
I am using TYPO3 6.2 (latest from git) but I guess this issue persists also in later versions.
Having a parent record which uses no deleted flag in the database (TCA ctrl > delete not set) results in actually deleting database entries on deletion in the backend.
If this parent record has an inline relation to a record which does use the deleted flag, it results in an odd behaviour on deletion of the parent record: The child records do not get deleted in the database and neither get the deleted flag set.
Apart from having dead entries (which are not marked as deleted) in the database this results in another problem when using translations. Consider the following scenario:
1.) Create a parent record.
2.) Create a child record as inline relation for the parent.
3.) Localise the parent record. The child record gets localised along with it automatically (in my example TCA, otherwise you can do it manually).
4.) Delete the translated parent record. Now the translated child records still exist (undeleted) in the database.
5.) Localise the parent record again. The localisation of the child record (no matter if automatically or manually) will fail because there is a localisation already in the database.
I will attach a little example extension with which you can reproduce the scenario. It uses FAL references for the inline relation.
About the desired behaviour:
At least the deleted flag should be set in the child records upon deletion of the parent record.
But since the parent record does not exist anymore, it could also make sense to ignore the deleted flag of the child record and also remove it completely from the database. It just has no reference anymore.
The problem seems to lie within TYPO3\CMS\Core\DataHandling\DataHandler::deleteRecord()
but I am not sure how to approach this issue best.
Files
Updated by Christian Kuhn over 8 years ago
First: Thanks for a very good issue explanation and for the test extension!
I'll in the currently ongoing sprint in cluj if anyone could transfer your test extension as test bed to ext:styleguide - this is our main tca test extension for such cases.
Updated by Christian Kuhn over 8 years ago
tx_styleguide_inline_parentnosoftdelete
Updated by Markus Klein over 8 years ago
- Category set to DataHandler aka TCEmain
- Status changed from New to Accepted
- Target version set to Candidate for patchlevel
- Complexity set to medium
- Sprint Focus set to On Location Sprint
Updated by Anja Leichsenring over 8 years ago
the PR has been accepted to ext:styleguide, and the version requirement has been raised for the core. So the test bed is now available in current core. Table is tx_styleguide_inline_parentnosoftdelete.
Updated by Gerrit Code Review over 8 years ago
- Status changed from Accepted 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/48101
Updated by Gerrit Code Review over 8 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/48101
Updated by Christian Kuhn over 8 years ago
- Sprint Focus deleted (
On Location Sprint)
Updated by Gerrit Code Review over 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/48101
Updated by Markus Klein over 5 years ago
- Related to Bug #79014: DataHandler not deleting inline and MM references if base table does not have a "delete"-field leads to DatabaseRecordException added