Bug #106678
openInvalid Sorting for pages in backend after copy/paste when TCA field "sorting" for pages is defined as "passthrough" needed for extbase
0%
Description
I'm using Extbase to create and/or update pages and Extbase need a real TCA declaration if you want to update fields (or fields are not persisted).
In some part of my proccess, I need to specify sorting for pages, so I need "sorting" field in TCA for pages (which is not provided by default by TYPO3), with something like :
$GLOBALS['TCA']['pages']['columns']['sorting'] = [
'config' => [
'type' => 'passthrough',
],
];
But when the "sorting" field is added in TCA declaration, something goes wrong in backend with "copy/paste after" function in pages tree.
For example, there is a pages tree :
"Folder Page" -> Page A -> Page B -> Page C -> Page D -> Page E -> Page F
If I right-click on "Page E" -> "Copy", and then right-click on "Page 1" -> Paste after" , the page is added but not after "Page A", the page is added after the copied page (Page E), resulting the following pages tree :
"Folder Page" -> Page A -> Page B -> Page C -> Page D -> Page E -> Page E (Copy 1) -> Page F
the sorting value of the added page is equal to the sorting value of the copied page (value not recalculated)
I've tried with different TCA type (type="input" / type="number") but the result is the same (sorting is not recalculated)
If I remove the TCA passthrough declaration, the "paste after" work as expected, but I can't update sorting with extbase anymore.
Function "Moving page" is not affected by this issue.
Adding a new page by drag and drop from the "drag and drop toolbar" (top of the pages tree) is not affected by this issue.
Tested on TYPO3 V12 and TYPO3 V13 (I don't have V14 project).
It's working fine on TYPO3 V11 (not affected by this issue).
No data to display