[FEATURE] Make translation of filelist optional 22/62922/3
authorNGUYEN Duc Quan <quan@apart.lu>
Wed, 15 Jan 2020 10:30:50 +0000 (11:30 +0100)
committerDaniel Goerz <daniel.goerz@posteo.de>
Thu, 16 Jan 2020 13:24:14 +0000 (14:24 +0100)
Adding the possibility to enable/disable filelist localization

Resolves: #90114
Releases: master
Change-Id: I42529e035a1325ff41cf7584db73b268ddc58ac1
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62922
Tested-by: Felix P. <f.pachowsky@neusta.de>
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Felix P. <f.pachowsky@neusta.de>
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
typo3/sysext/core/Documentation/Changelog/master/Feature-90114-DisableTranslationOfFilelist.rst [new file with mode: 0644]
typo3/sysext/filelist/Classes/FileList.php

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Feature-90114-DisableTranslationOfFilelist.rst b/typo3/sysext/core/Documentation/Changelog/master/Feature-90114-DisableTranslationOfFilelist.rst
new file mode 100644 (file)
index 0000000..b1e66c0
--- /dev/null
@@ -0,0 +1,26 @@
+.. include:: ../../Includes.txt
+
+=================================================
+Feature: #90114 - Disable translation of filelist
+=================================================
+
+See :issue:`90114`
+
+Description
+===========
+
+Currently there is no simple solution to disable/enable the translation of the files in the (BE menu) filelist.
+
+But this could be done programmatically by unsetting languageField in the sys_file_metadata.php like
+
+`unset($GLOBALS['TCA']['sys_file_metadata']['ctrl']['languageField']);`
+
+
+Impact
+======
+
+If unsetting
+`$GLOBALS['TCA']['sys_file_metadata']['ctrl']['languageField']`
+then the world toggle button in the (BE) Filelist would disappear which means that translating the metadata the file metadata are not possible anymore. Be aware that existing translations may also become unaccessible, at least via BE.
+
+.. index:: Backend, FAL, TCA, ext:filelist
index c0918af..fcb49d5 100644 (file)
@@ -1015,7 +1015,7 @@ class FileList
                         $theData[$field] = $this->makeClip($fileObject);
                         break;
                     case '_LOCALIZATION_':
-                        if (!empty($systemLanguages) && $fileObject->isIndexed() && $fileObject->checkActionPermission('editMeta') && $this->getBackendUser()->check('tables_modify', 'sys_file_metadata')) {
+                        if (!empty($systemLanguages) && $fileObject->isIndexed() && $fileObject->checkActionPermission('editMeta') && $this->getBackendUser()->check('tables_modify', 'sys_file_metadata') && !is_null($GLOBALS['TCA']['sys_file_metadata']['ctrl']['languageField'])) {
                             $metaDataRecord = $fileObject->getMetaData()->get();
                             $translations = $this->getTranslationsForMetaData($metaDataRecord);
                             $languageCode = '';