You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
copy translated freemode pages. In the copy, the grids remain empty because the colPos still refers to the original. It only happens in the translation of the pages, default language is copied correctly.
Correctly, they should have the new colPos, so the grids appear empty. But in fact the content elements are there (visible with list module).
The following code in the file EXT:flux/Classes/Integration/HookSubscribers/DataHandlerSubscriber.php fixes the problem. It is only tested with freemode pages.
// Change this
// ===========================
public function processCmdmap_postProcess(
&$command,
$table,
$id,
&$relativeTo,
&$reference,
&$pasteUpdate,
&$pasteDataMap
) {
/*
if ($table === 'pages' && $command === 'copy') {
foreach ($reference->copyMappingArray['tt_content'] ?? [] as $originalRecordUid => $copiedRecordUid) {
$copiedRecord = $this->getSingleRecordWithoutRestrictions('tt_content', $copiedRecordUid, 'colPos');
if ($copiedRecord['colPos'] < ColumnNumberUtility::MULTIPLIER) {
continue;
}
$oldParentUid = ColumnNumberUtility::calculateParentUid($copiedRecord['colPos']);
$newParentUid = $reference->copyMappingArray['tt_content'][$oldParentUid];
$overrideArray['colPos'] = ColumnNumberUtility::calculateColumnNumberForParentAndColumn(
$newParentUid,
ColumnNumberUtility::calculateLocalColumnNumber((int) $copiedRecord['colPos'])
);
// Note here: it is safe to directly update the DB in this case, since we filtered out any
// non-"copy" actions, and "copy" is the only action which requires adjustment.
$reference->updateDB('tt_content', $copiedRecordUid, $overrideArray);
// But if we also have a workspace version of the record recorded, it too must be updated:
if (isset($reference->autoVersionIdMap['tt_content'][$copiedRecordUid])) {
$reference->updateDB(
'tt_content',
$reference->autoVersionIdMap['tt_content'][$copiedRecordUid],
$overrideArray
);
}
}
}
*/
// Into this
// ===========================
public function processCmdmap_postProcess(
&$command,
$table,
$id,
&$relativeTo,
&$reference,
&$pasteUpdate,
&$pasteDataMap
) {
if ($table === 'pages' && $command === 'copy') {
foreach ($reference->copyMappingArray['tt_content'] ?? [] as $originalRecordUid => $copiedRecordUid) {
$copiedRecord = $this->getSingleRecordWithoutRestrictions('tt_content', $copiedRecordUid, 'colPos');
if ($copiedRecord['colPos'] < ColumnNumberUtility::MULTIPLIER) {
continue;
}
$originalRecord = $this->getSingleRecordWithoutRestrictions('tt_content', $originalRecordUid, 'colPos');
$oldParentUid = ColumnNumberUtility::calculateParentUid($originalRecord['colPos']);
$newParentUid = $reference->copyMappingArray['tt_content'][$oldParentUid];
$overrideArray['colPos'] = ColumnNumberUtility::calculateColumnNumberForParentAndColumn(
$newParentUid,
ColumnNumberUtility::calculateLocalColumnNumber((int) $copiedRecord['colPos'])
);
// Note here: it is safe to directly update the DB in this case, since we filtered out any
// non-"copy" actions, and "copy" is the only action which requires adjustment.
$reference->updateDB('tt_content', $copiedRecordUid, $overrideArray);
// But if we also have a workspace version of the record recorded, it too must be updated:
if (isset($reference->autoVersionIdMap['tt_content'][$copiedRecordUid])) {
$reference->updateDB('tt_content', $reference->autoVersionIdMap['tt_content'][$copiedRecordUid], $overrideArray);
}
}
}
The text was updated successfully, but these errors were encountered:
Just a quick note for now: this code block was deactivated because it caused problems with other copy operations. Unfortunately, TYPO3 chose to use the copy command instead of a unique command when triggering a "translate" operation in free mode. Last time I checked there was no way to distinguish a normal copy command from a copy command triggered by translating. This was quite some time ago though, so I'll leave the issue open as a reminder to check if there's a way today to only trigger this block in context of a "translate" action in free mode.
In my case it works with TYPO3 11.5.x. As already described, I have not tried it with connected mode and cannot say whether it has an effect in copied pages.
I am very interested to hear your results and hope that TYPO3 will provide better interfaces for such cases.
There should be no negative effects in connected mode, since IIRC the command then changes to copyToLanguage which of course doesn't trigger this block. It's only free mode that causes a bit of a headache.
Hello,
Flux 9.7.2
TYPO3 11.5.x
copy translated freemode pages. In the copy, the grids remain empty because the colPos still refers to the original. It only happens in the translation of the pages, default language is copied correctly.
Correctly, they should have the new colPos, so the grids appear empty. But in fact the content elements are there (visible with list module).
The following code in the file
EXT:flux/Classes/Integration/HookSubscribers/DataHandlerSubscriber.php
fixes the problem. It is only tested with freemode pages.// Change this
// ===========================
// Into this
// ===========================
The text was updated successfully, but these errors were encountered: