Commit a0d0752e authored by Rens Admiraal's avatar Rens Admiraal Committed by Frank Nägler
Browse files

[FEATURE] Hide "duplicate" button by default

Hides the "duplicate" button in TCEFORMs by default as it serves
a very specific usecase best enabled on a table basis.

Example snippet:
```
options.showDuplicate = 1
options.showDuplicate.[table] = 1
```

Resolves: #84749
Releases: master
Change-Id: Ia15202e197b81ff4d97f6e71b673910ec7cded93
Reviewed-on: https://review.typo3.org/56686

Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarMathias Schreiber <mathias.schreiber@typo3.com>
Tested-by: default avatarMathias Schreiber <mathias.schreiber@typo3.com>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Frans Saris's avatarFrans Saris <franssaris@gmail.com>
Reviewed-by: Richard Haeser's avatarRichard Haeser <richard@maxserv.com>
Tested-by: Richard Haeser's avatarRichard Haeser <richard@maxserv.com>
Reviewed-by: Frank Nägler's avatarFrank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Nägler's avatarFrank Naegler <frank.naegler@typo3.org>
parent 85c8d65e
......@@ -1479,7 +1479,13 @@ class EditDocumentController
? (int)$record[$TCActrl['languageField']]
: 0;
$showDuplicateButton = false;
if ($this->firstEl['cmd'] !== 'new' && $this->firstEl['table'] !== 'sys_file_metadata' && MathUtility::canBeInterpretedAsInteger($this->firstEl['uid'])) {
if (
$this->firstEl['cmd'] !== 'new'
&& $this->firstEl['table'] !== 'sys_file_metadata'
&& MathUtility::canBeInterpretedAsInteger($this->firstEl['uid'])
&& !empty($this->firstEl['table'])
&& $this->getTsConfigOption($this->firstEl['table'], 'showDuplicate')
) {
if ($sysLanguageUid === 0) {
// show button, if record is in default language
$showDuplicateButton = true;
......
.. include:: ../../Includes.txt
====================================================
Feature: #84749 - Hide "duplicate" button by default
====================================================
See :issue:`84749`
Description
===========
The "duplicate" button visibility can now be managed with userTsConfig using:
options.showDuplicate = 1
options.showDuplicate.[table] = 1
Impact
======
The button was only introduced in 9.0, but would with this change be hidden again.
.. index:: Backend, TSConfig, ext:backend
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment