Bug #89622
closedTCA ctrl setting hideAtCopy not considered for pages during localization
100%
Description
- actually
hideAtCopy
is already misleading for regular elements (non-pages) - however, behavior should be similar for all entity types
- alternative: document behavior and exceptions at https://docs.typo3.org/m/typo3/reference-tca/master/en-us/Ctrl/Index.html#hideatcopy
Updated by Oliver Hader almost 5 years ago
- Related to Bug #88248: page translations are hidden by default added
Updated by André Buchmann almost 3 years ago
Struggling with this issue currently in a TYPO3 10.4.21 project. Usecase:
Pages are mostly translated via l10nmgr workflow. On import we want to have alle content elements enabled and therefore use the PageTS setting disablehideatcopy = 1
(see https://docs.typo3.org/m/typo3/reference-tsconfig/master/en-us/PageTsconfig/TceMain.html#disablehideatcopy) for tt_content and other inline element tables. And the page itself should be disabled, no matter if the source is enabled or hidden. But the configuration doesn't work for the pages table.
TCEMAIN.table { pages { disableHideAtCopy = 0 # does not work (no matter if 0 or 1) } tt_content { disableHideAtCopy = 1 } tx_myext_element { disableHideAtCopy = 1 } }
As the DataHandler::localize() method copies the hidden value to the $overrideValues
from the source, the DataHandler::copyRecord() method doesn't apply the "hide at copy"-override anymore. Currently I don't see a solution how I con apply the wanted behavior via configuration.
DataHandler::localize()
// Create new page which needs to contain the same pid as the original page
$overrideValues['pid'] = $row['pid'];
// Take over the hidden state of the original language state, this is done due to legacy reasons where-as
// pages_language_overlay was set to "hidden -> default=0" but pages hidden -> default 1"
if (!empty($GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['disabled'])) {
$hiddenFieldName = $GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['disabled'];
$overrideValues[$hiddenFieldName] = $row[$hiddenFieldName] ?? $GLOBALS['TCA'][$table]['columns'][$hiddenFieldName]['config']['default'];
}
DataHandler::copyRecord()
if ($field === 'pid') {
$value = $destPid;
} elseif (array_key_exists($field, $overrideValues)) {
// Override value...
$value = $overrideValues[$field];
} elseif (array_key_exists($field, $copyAfterFields)) {
// Copy-after value if available:
$value = $copyAfterFields[$field];
} else {
// Hide at copy may override:
if ($first && $field == $enableField && $GLOBALS['TCA'][$table]['ctrl']['hideAtCopy'] && !$this->neverHideAtCopy && !$tE['disableHideAtCopy']) {
$value = 1;
}
// Prepend label on copy:
if ($first && $field == $headerField && $GLOBALS['TCA'][$table]['ctrl']['prependAtCopy'] && !$tE['disablePrependAtCopy']) {
$value = $this->getCopyHeader($table, $this->resolvePid($table, $destPid), $field, $this->clearPrefixFromValue($table, $value), 0);
}
// Processing based on the TCA config field type (files, references, flexforms...)
$value = $this->copyRecord_procBasedOnFieldType($table, $uid, $field, $value, $row, $conf, $tscPID, $language);
}
// Add value to array.
$data[$table][$theNewID][$field] = $value;
Updated by Gerrit Code Review almost 3 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/+/71556
Updated by Gerrit Code Review almost 3 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/+/71556
Updated by Gerrit Code Review almost 3 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/+/71556
Updated by Gerrit Code Review almost 3 years ago
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/+/71556
Updated by Gerrit Code Review almost 3 years ago
Patch set 5 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/+/71556
Updated by Gerrit Code Review almost 3 years ago
Patch set 6 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/+/71556
Updated by Gerrit Code Review almost 3 years ago
Patch set 7 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/+/71556
Updated by André Buchmann almost 3 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 4fd30373d5c21aa916b642f51c79262e05d42b45.
Updated by Benni Mack almost 2 years ago
- Status changed from Resolved to Closed