Project

General

Profile

Actions

Bug #76138

open

Inline Relations - Delete Behaviour with mixed Usage of the Deleted Flag

Added by Stephan Ude over 8 years ago. Updated about 6 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
DataHandler aka TCEmain
Start date:
2016-05-11
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
medium
Is Regression:
No
Sprint Focus:

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


Related issues 1 (1 open0 closed)

Related to TYPO3 Core - Bug #79014: DataHandler not deleting inline and MM references if base table does not have a "delete"-field leads to DatabaseRecordException⁠⁠⁠⁠Under ReviewStephan Großberndt2016-12-16

Actions
Actions

Also available in: Atom PDF