Project

General

Profile

Actions

Bug #91609

closed

DataHandler::copyRecord_raw can lead to recursion

Added by B. Kausch over 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
DataHandler aka TCEmain
Target version:
-
Start date:
2020-06-08
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.3
Tags:
pending-close
Complexity:
medium
Is Regression:
Sprint Focus:

Description

Example: You have a game table/record, which you can add to a page. The page columns are extended in following way.

'game' => [
    'config' => [
        'type' => 'inline',
        'foreign_table' => 'tx_example_domain_model_game',
        'foreign_field' => 'page',
        'minitems' => 0,
        'maxitems' => 1,
    ],
],

Now let us say, this game record has a relation to pages, maybe like this:

'detail_page' => [
    'config' => [
        'type' => 'inline',
        'foreign_table' => 'pages',
        'minitems' => 0,
        'maxitems' => 1,
    ],
],

So, we have a page with the uid 99. We add a game record with the uid 2. And the we edit the detail_page field and select the page 99. When you now try to copy the page 99 and insert it somewhere in the page tree the recursion begins. You can follow the methods in DataHandler:

(1) ::copySpecificPage(99, ...)
(2) ::copyRecord('pages', 99, ...)
.
. iterate over fields to copy until game
.
(3) ::copyRecord_procBasedOnFieldType('pages', 99, 'game', ...)
(4) ::copyRecord_processInline('pages', 99, 'game', ...)
(5) ::copyRecord_raw('tx_example_domain_model_game', ...)
.
. iterate over fields to copy until detail_page
.
(6) ::copyRecord_procBasedOnFieldType('tx_example_domain_model_game', 2, 'detail_page', ...)
(7) ::copyRecord_processInline('tx_example_domain_model_game', 2, 'detail_page', ...)
(8) ::copyRecord_raw('pages', ...)

Go back to (3). And so on and on and on...

Actions

Also available in: Atom PDF