Project

General

Profile

Actions

Bug #76138

open

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

Added by Stephan Ude almost 8 years ago. Updated over 5 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 #1

Updated by Christian Kuhn almost 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.

Actions #2

Updated by Christian Kuhn almost 8 years ago

tx_styleguide_inline_parentnosoftdelete

Actions #3

Updated by Markus Klein almost 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
Actions #4

Updated by Anja Leichsenring almost 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.

Actions #5

Updated by Gerrit Code Review almost 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

Actions #6

Updated by Gerrit Code Review almost 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

Actions #7

Updated by Christian Kuhn almost 8 years ago

  • Sprint Focus deleted (On Location Sprint)
Actions #8

Updated by Gerrit Code Review almost 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

Actions #9

Updated by Benni Mack over 5 years ago

  • Status changed from Under Review to New
Actions #10

Updated by Markus Klein over 4 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
Actions

Also available in: Atom PDF