#91609DataHandler::copyRecord_raw can lead to recursion
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…
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.