Bug #92804
closedSorting of inline records that contain inline records breaks the database
100%
Description
Sorting inline records (let's call them 'parent records') that contain more inline records (let's call these 'children records') in FormEngine results in a mix of uids of parent and children records that are saved within the database.
This only happens when the child records of a parent record are loaded, i.e. if a parent record is/was opened.
I suspect that the FormEngine JavaScript is responsible for getting the newly sorted uids in the correct order: during this search, the correct field is searched, but the different levels of records are not handled correctly.
This is my best guess as to why the wrong UIDs are passed to the DataHandler.
To reproduce add the following TCA/database definitions (or use the files that I added), add a few records and then re-sort the parent records with one of them being open.
"[...]/Configuration/TCA/tx_test_case.php":
<?php
return [
'ctrl' => [
'title' => 'IRRE sorting test',
'label' => 'name'
],
'columns' => [
'name' => [
'label' => 'Name',
'config' => [
'type' => 'input'
]
],
'records' => [
'label' => 'Parent IRRE records',
'config' => [
'type' => 'inline',
'foreign_table' => 'tx_test_parent',
'foreign_sortby' => 'sorting',
'appearance' => [
'useSortable' => true,
'enabledControls' => [
'sort' => true,
'dragdrop' => true
]
]
]
]
],
'types' => [
0 => [
'showitem' => 'name,records'
]
]
];
"[...]/Configuration/TCA/tx_test_parent.php":
<?php
return [
'ctrl' => [
'title' => 'IRRE sorting test parent record',
'label' => 'name'
],
'columns' => [
'name' => [
'label' => 'Name',
'config' => [
'type' => 'input'
]
],
'children' => [
'label' => 'Children IRRE records',
'config' => [
'type' => 'inline',
'foreign_table' => 'tx_test_child',
'foreign_sortby' => 'sorting',
'appearance' => [
'useSortable' => true,
'enabledControls' => [
'sort' => true,
'dragdrop' => true
]
],
]
]
],
'types' => [
0 => [
'showitem' => 'name,children'
]
]
];
"[...]/Configuration/TCA/tx_test_child.php":
<?php
return [
'ctrl' => [
'title' => 'IRRE sorting test child record',
'label' => 'name'
],
'columns' => [
'name' => [
'label' => 'Name',
'config' => [
'type' => 'input'
]
]
],
'types' => [
0 => [
'showitem' => 'name'
]
]
];
"[...]/ext_tables.sql":
CREATE TABLE `tx_test_case` (
`name` text,
`records` text
);
CREATE TABLE `tx_test_parent` (
`name` text,
`children` text,
`sorting` int(11) default 0 not null
);
CREATE TABLE `tx_test_child` (
`name` text,
`sorting` int(11) default 0 not null
);
Files
Updated by Gerrit Code Review almost 4 years ago
- Status changed from New 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/c/Packages/TYPO3.CMS/+/66933
Updated by Gerrit Code Review almost 4 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/c/Packages/TYPO3.CMS/+/66933
Updated by Gerrit Code Review almost 4 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/c/Packages/TYPO3.CMS/+/66933
Updated by Gerrit Code Review almost 4 years ago
Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67253
Updated by Andreas Fernandez almost 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 8d32036bb3c85c827c228c9d4a462ee6c3383e5d.
Updated by Gerrit Code Review almost 4 years ago
- Status changed from Resolved to Under Review
Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/66933
Updated by Andreas Fernandez almost 4 years ago
- Status changed from Under Review to Resolved
Applied in changeset d94b1b5b1ebc3621f2f6ae62eb691567438050e2.