Commit a488a828 authored by Fabian Galinski's avatar Fabian Galinski 😾

[TASK] Removal of 2 unused fields of the sys_languages table

parent 828ab7cf
......@@ -348,14 +348,12 @@ class VisibilityService implements SingletonInterface {
if ($this->cachedDefaultVisibilityForElements === NULL) {
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getConnectionForTable('sys_language');
$results = $queryBuilder->prepare(
'SELECT uid, tx_languagevisibility_defaultvisibilityel FROM sys_language'
);
$results = $queryBuilder->prepare('SELECT uid FROM sys_language');
$this->cachedDefaultVisibilityForElements[0] = 'fallback';
if ($results->execute()) {
foreach ($results->fetchAll() as $entry) {
$this->cachedDefaultVisibilityForElements[$entry['uid']] = $entry['tx_languagevisibility_defaultvisibilityel'];
$this->cachedDefaultVisibilityForElements[$entry['uid']] = 'active';
}
}
}
......@@ -376,19 +374,15 @@ class VisibilityService implements SingletonInterface {
* @throws DBALException
*/
protected function getDefaultVisibilityForPagesByLanguage($languageUid): string {
if ($this->cachedDefaultVisibilityForPages === NULL) {
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getConnectionForTable('sys_language');
$results = $queryBuilder->prepare(
'SELECT uid, tx_languagevisibility_defaultvisibility FROM sys_language'
);
$results = $queryBuilder->prepare('SELECT uid FROM sys_language');
$this->cachedDefaultVisibilityForPages[0] = 'fallback';
if ($results->execute()) {
foreach ($results->fetchAll() as $entry) {
$this->cachedDefaultVisibilityForPages[$entry['uid']] = $entry['tx_languagevisibility_defaultvisibility'];
$this->cachedDefaultVisibilityForPages[$entry['uid']] = 'active';
}
}
}
......
<?php
/**
*
* Copyright notice
*
* (c) sgalinski Internet Services (https://www.sgalinski.de)
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
*/
call_user_func(
static function ($extKey, $table) {
$tempColumns = [
'tx_languagevisibility_defaultvisibility' => [
'exclude' => 0,
'label' => 'LLL:EXT:' . $extKey . '/Resources/Private/Language/locallang_db.xlf:' . $table . '.tx_languagevisibility_defaultvisibility',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'items' => [
['LLL:EXT:' . $extKey . '/Resources/Private/Language/locallang_db.xlf:tx_languagevisibility_visibility.I.active', 'active'],
['LLL:EXT:' . $extKey . '/Resources/Private/Language/locallang_db.xlf:tx_languagevisibility_visibility.I.translated', 'translated'],
['LLL:EXT:' . $extKey . '/Resources/Private/Language/locallang_db.xlf:tx_languagevisibility_visibility.I.fallback', 'fallback'],
['LLL:EXT:' . $extKey . '/Resources/Private/Language/locallang_db.xlf:tx_languagevisibility_visibility.I.enforce', 'enforce'],
['LLL:EXT:' . $extKey . '/Resources/Private/Language/locallang_db.xlf:tx_languagevisibility_visibility.I.inactive', 'inactive'],
],
'default' => 'fallback',
'size' => 1,
'maxitems' => 1,
]
],
'tx_languagevisibility_defaultvisibilityel' => [
'exclude' => 0,
'label' => 'LLL:EXT:' . $extKey . '/Resources/Private/Language/locallang_db.xlf:' . $table . '.tx_languagevisibility_defaultvisibilityel',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'items' => [
['LLL:EXT:' . $extKey . '/Resources/Private/Language/locallang_db.xlf:tx_languagevisibility_visibility.I.active', 'active'],
['LLL:EXT:' . $extKey . '/Resources/Private/Language/locallang_db.xlf:tx_languagevisibility_visibility.I.translated', 'translated'],
['LLL:EXT:' . $extKey . '/Resources/Private/Language/locallang_db.xlf:tx_languagevisibility_visibility.I.fallback', 'fallback'],
['LLL:EXT:' . $extKey . '/Resources/Private/Language/locallang_db.xlf:tx_languagevisibility_visibility.I.enforce', 'enforce'],
['LLL:EXT:' . $extKey . '/Resources/Private/Language/locallang_db.xlf:tx_languagevisibility_visibility.I.inactive', 'inactive'],
],
'default' => 'fallback',
'size' => 1,
'maxitems' => 1,
]
],
];
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns($table, $tempColumns);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes(
$table, 'tx_languagevisibility_defaultvisibility, tx_languagevisibility_defaultvisibilityel'
);
}, 'languagevisibility', 'sys_language'
);
......@@ -59,14 +59,6 @@
<source>OK</source>
<target>OK</target>
</trans-unit>
<trans-unit id="sys_language.tx_languagevisibility_defaultvisibility" approved="yes">
<source>default visibility for pages</source>
<target>Standard-Sichtbarkeit für Seiten</target>
</trans-unit>
<trans-unit id="sys_language.tx_languagevisibility_defaultvisibilityel" approved="yes">
<source>default visibility for other elements</source>
<target>Standard-Sichtbarkeit für Elemente</target>
</trans-unit>
<trans-unit id="tabname" approved="yes">
<source>Language</source>
<target>Sprache</target>
......
......@@ -46,12 +46,6 @@
<trans-unit id="reports.ok.value">
<source>OK</source>
</trans-unit>
<trans-unit id="sys_language.tx_languagevisibility_defaultvisibility">
<source>default visibility for pages</source>
</trans-unit>
<trans-unit id="sys_language.tx_languagevisibility_defaultvisibilityel">
<source>default visibility for other elements</source>
</trans-unit>
<trans-unit id="tabname">
<source>Language</source>
</trans-unit>
......
#
# Table structure for table 'sys_language'
#
CREATE TABLE sys_language (
tx_languagevisibility_defaultvisibility varchar(11) DEFAULT 'translated' NOT NULL,
tx_languagevisibility_defaultvisibilityel varchar(11) DEFAULT 'translated' NOT NULL
);
#
# Table structure for table 'pages'
#
......
Markdown is supported
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