File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 2020use IchHabRecht \ContentDefender \BackendLayout \BackendLayoutConfiguration ;
2121use TYPO3 \CMS \Backend \Utility \BackendUtility ;
2222use TYPO3 \CMS \Core \DataHandling \DataHandler ;
23+ use TYPO3 \CMS \Core \Utility \StringUtility ;
2324
2425class CmdmapDataHandlerHook extends AbstractDataHandlerHook
2526{
@@ -42,7 +43,10 @@ public function processCmdmap_beforeStart(DataHandler $dataHandler)
4243
4344 $ currentRecord = BackendUtility::getRecord ('tt_content ' , $ id );
4445
45- if ($ command === 'move ' ) {
46+ if ($ command === 'copy ' ) {
47+ // Enforce a new uid when copying a record to ensure correct maxItems validation
48+ $ currentRecord ['uid ' ] .= StringUtility::getUniqueId ('-NEW ' );
49+ } else {
4650 // New colPos is passed as datamap array and already processed in processDatamap_beforeStart
4751 $ data = isset ($ dataHandler ->datamap ['tt_content ' ][$ id ])
4852 ? $ dataHandler ->datamap : ($ _POST ['data ' ] ?? $ _GET ['data ' ] ?? null );
You can’t perform that action at this time.
0 commit comments