Skip to content

Commit

Permalink
[BUGFIX] DatabaseRecordList: Respect connected translation mode
Browse files Browse the repository at this point in the history
Do not allow creating new records after translated records in the
connected translation mode.
Furthermore, disable cut, copy and paste for translated records
in the connected translation mode.
Finally, disable move records in the connected translation mode.

Releases: master, 10.4
Resolves: #92084
Change-Id: I3a8bc68f572984d6c01a18719223a1e23a9034a8
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/65445
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
  • Loading branch information
dawind authored and maddy2101 committed Aug 25, 2020
1 parent 01fc0b6 commit 1502c20
Showing 1 changed file with 3 additions and 5 deletions.
Expand Up @@ -1758,8 +1758,7 @@ public function makeControl($table, $row)
'secondary' => []
];
// Enables to hide the move elements for localized records - doesn't make much sense to perform these options for them
// For page translations these icons should never be shown
$isL10nOverlay = $table === 'pages' && $row[$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']] != 0;
$isL10nOverlay = $row[$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']] != 0;
if ($table === 'pages') {
// If the listed table is 'pages' we have to request the permission settings for each page.
$localCalcPerms = $backendUser->calcPerms(BackendUtility::getRecord('pages', $row['uid']));
Expand Down Expand Up @@ -1855,7 +1854,7 @@ public function makeControl($table, $row)
// or if default values can depend on previous record):
if (($GLOBALS['TCA'][$table]['ctrl']['sortby'] || $GLOBALS['TCA'][$table]['ctrl']['useColumnsForDefaultValues']) && $permsEdit) {
if ($table !== 'pages' && $this->calcPerms & Permission::CONTENT_EDIT || $table === 'pages' && $this->calcPerms & Permission::PAGE_NEW) {
if ($table === 'pages' && $isL10nOverlay) {
if ($isL10nOverlay) {
$this->addActionToCellGroup($cells, $this->spaceIcon, 'new');
} elseif ($this->showNewRecLink($table)) {
$params = '&edit[' . $table . '][' . -($row['_MOVE_PLH'] ? $row['_MOVE_PLH_uid'] : $row['uid']) . ']=new';
Expand Down Expand Up @@ -2078,8 +2077,7 @@ public function makeClip($table, $row)
$cells = [];
$cells['pasteAfter'] = ($cells['pasteInto'] = $this->spaceIcon);
// Enables to hide the copy, cut and paste icons for localized records - doesn't make much sense to perform these options for them
// For page translations these icons should never be shown
$isL10nOverlay = $table === 'pages' && $row[$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']] != 0;
$isL10nOverlay = $row[$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']] != 0;
// Return blank, if disabled:
// Whether a numeric clipboard pad is active or the normal pad we will see different content of the panel:
// For the "Normal" pad:
Expand Down

0 comments on commit 1502c20

Please sign in to comment.