[!!!][TASK] Remove v7->v8 upgrade wizards 40/59440/3
authorChristian Kuhn <lolli@schwarzbu.ch>
Tue, 15 Jan 2019 11:34:04 +0000 (12:34 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Tue, 15 Jan 2019 13:37:37 +0000 (14:37 +0100)
Upgrade wizards created to upgrade from v7 to v8
are removed now. Note the DatabaseRowUpdater
mini-framework wizard does not register single
row updaters at the moment, is disabled but the
class is kept.

Resolves: #87440
Releases: master
Change-Id: If84dd1f0ce710f535e39516b984b94a9df2bccb2
Reviewed-on: https://review.typo3.org/59440
Tested-by: TYPO3com <noreply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
31 files changed:
typo3/sysext/core/Documentation/Changelog/master/Breaking-87193-DeprecatedFunctionalityRemoved.rst
typo3/sysext/install/Classes/Updates/BulletContentElementUpdate.php [deleted file]
typo3/sysext/install/Classes/Updates/CommandLineBackendUserRemovalUpdate.php [deleted file]
typo3/sysext/install/Classes/Updates/Compatibility7ExtractionUpdate.php [deleted file]
typo3/sysext/install/Classes/Updates/DatabaseRowsUpdateWizard.php
typo3/sysext/install/Classes/Updates/FileReferenceUpdate.php [deleted file]
typo3/sysext/install/Classes/Updates/FillTranslationSourceField.php [deleted file]
typo3/sysext/install/Classes/Updates/FormLegacyExtractionUpdate.php [deleted file]
typo3/sysext/install/Classes/Updates/FrontendUserImageUpdateWizard.php [deleted file]
typo3/sysext/install/Classes/Updates/LanguageSortingUpdate.php [deleted file]
typo3/sysext/install/Classes/Updates/MigrateFeSessionDataUpdate.php [deleted file]
typo3/sysext/install/Classes/Updates/MigrateFscStaticTemplateUpdate.php [deleted file]
typo3/sysext/install/Classes/Updates/RowUpdater/ImageCropUpdater.php [deleted file]
typo3/sysext/install/Classes/Updates/RowUpdater/L10nModeUpdater.php [deleted file]
typo3/sysext/install/Classes/Updates/RowUpdater/RteLinkSyntaxUpdater.php [deleted file]
typo3/sysext/install/Classes/Updates/RteHtmlAreaExtractionUpdate.php [deleted file]
typo3/sysext/install/Classes/Updates/SectionFrameToFrameClassUpdate.php [deleted file]
typo3/sysext/install/Classes/Updates/SplitMenusUpdate.php [deleted file]
typo3/sysext/install/Classes/Updates/StartModuleUpdate.php [deleted file]
typo3/sysext/install/Classes/Updates/UploadContentElementUpdate.php [deleted file]
typo3/sysext/install/Classes/Updates/WizardDoneToRegistry.php [deleted file]
typo3/sysext/install/Tests/Functional/Updates/CommandLineBackendUserRemovalUpdateTest.php [deleted file]
typo3/sysext/install/Tests/Functional/Updates/DataSet/CommandLineBackendUserRemovalAfter.csv [deleted file]
typo3/sysext/install/Tests/Functional/Updates/DataSet/CommandLineBackendUserRemovalBefore.csv [deleted file]
typo3/sysext/install/Tests/Functional/Updates/RowUpdater/DataSet/LiveDefaultElements.csv [deleted file]
typo3/sysext/install/Tests/Functional/Updates/RowUpdater/DataSet/LiveDefaultPages.csv [deleted file]
typo3/sysext/install/Tests/Functional/Updates/RowUpdater/DataSet/recordsCanBeUpdated.csv [deleted file]
typo3/sysext/install/Tests/Functional/Updates/RowUpdater/L10nModeUpdaterTest.php [deleted file]
typo3/sysext/install/Tests/Unit/Updates/Compatibility7ExtractionUpdateTest.php [deleted file]
typo3/sysext/install/Tests/Unit/Updates/RowUpdater/L10nModeUpdaterTest.php [deleted file]
typo3/sysext/install/ext_localconf.php

index 7e22d75..c1586d3 100644 (file)
@@ -1294,6 +1294,7 @@ The following features have been removed:
 * TCA auto migration from core v6 to core v7 compatible TCA
 * TCA :php:`type='group'` with :php:`internal_type='file'` and :php:`internal_type='file_reference`
 * Cache creation using :php:`\TYPO3\CMS\Cache\CacheManger` during :php:`ext_localconf.php` loading
+* All install tool upgrade wizards upgrading from v7 to v8 have been removed
 
 
 The following database tables have been removed:
diff --git a/typo3/sysext/install/Classes/Updates/BulletContentElementUpdate.php b/typo3/sysext/install/Classes/Updates/BulletContentElementUpdate.php
deleted file mode 100644 (file)
index eff662a..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-<?php
-namespace TYPO3\CMS\Install\Updates;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Database\ConnectionPool;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-
-/**
- * Migrate bullet content element rendering from layout to bullets_type
- * @internal This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.
- */
-class BulletContentElementUpdate implements UpgradeWizardInterface
-{
-    /**
-     * @return string Unique identifier of this updater
-     */
-    public function getIdentifier(): string
-    {
-        return 'bulletContentElementUpdate';
-    }
-
-    /**
-     * @return string Title of this updater
-     */
-    public function getTitle(): string
-    {
-        return 'Migrate bullet content element rendering selector from layout to bullets_type';
-    }
-
-    /**
-     * @return string Longer description of this updater
-     */
-    public function getDescription(): string
-    {
-        return 'Rendering type field has been streamlined with fluid_styled_content.';
-    }
-
-    /**
-     * Checks if an update is needed
-     *
-     * @return bool Whether an update is needed (TRUE) or not (FALSE)
-     */
-    public function updateNecessary(): bool
-    {
-        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tt_content');
-        $queryBuilder->getRestrictions()->removeAll();
-        $elementCount = $queryBuilder->count('uid')
-            ->from('tt_content')
-            ->where(
-                $queryBuilder->expr()->eq('CType', $queryBuilder->createNamedParameter('bullets', \PDO::PARAM_STR)),
-                $queryBuilder->expr()->in('layout', [1, 2])
-            )
-            ->execute()
-            ->fetchColumn(0);
-        return (bool)$elementCount;
-    }
-
-    /**
-     * @return string[] All new fields and tables must exist
-     */
-    public function getPrerequisites(): array
-    {
-        return [
-            DatabaseUpdatedPrerequisite::class
-        ];
-    }
-
-    /**
-     * Performs the database update
-     *
-     * @return bool
-     */
-    public function executeUpdate(): bool
-    {
-        $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('tt_content');
-        $queryBuilder = $connection->createQueryBuilder();
-        $queryBuilder->getRestrictions()->removeAll();
-        $statement = $queryBuilder->select('uid', 'layout')
-            ->from('tt_content')
-            ->where(
-                $queryBuilder->expr()->eq('CType', $queryBuilder->createNamedParameter('bullets', \PDO::PARAM_STR)),
-                $queryBuilder->expr()->in('layout', [1, 2])
-            )
-            ->execute();
-        while ($record = $statement->fetch()) {
-            $queryBuilder = $connection->createQueryBuilder();
-            $queryBuilder->update('tt_content')
-                ->where(
-                    $queryBuilder->expr()->eq(
-                        'uid',
-                        $queryBuilder->createNamedParameter($record['uid'], \PDO::PARAM_INT)
-                    )
-                )
-                ->set('layout', 0, false)
-                ->set('bullets_type', $record['layout']);
-            $queryBuilder->execute();
-        }
-        return true;
-    }
-}
diff --git a/typo3/sysext/install/Classes/Updates/CommandLineBackendUserRemovalUpdate.php b/typo3/sysext/install/Classes/Updates/CommandLineBackendUserRemovalUpdate.php
deleted file mode 100644 (file)
index a32f6b4..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-<?php
-
-namespace TYPO3\CMS\Install\Updates;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use Symfony\Component\Console\Output\OutputInterface;
-use TYPO3\CMS\Core\Database\ConnectionPool;
-use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-
-/**
- * Remove all backend users starting with _cli_
- * @internal This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.
- */
-class CommandLineBackendUserRemovalUpdate implements UpgradeWizardInterface, ChattyInterface, RepeatableInterface, ConfirmableInterface
-{
-    /**
-     * @var OutputInterface
-     */
-    protected $output;
-
-    /**
-     * @var Confirmation
-     */
-    protected $confirmation;
-
-    public function __construct()
-    {
-        $this->confirmation = new Confirmation(
-            'Are you sure?',
-            'The following backend users will be removed: ' . implode(', ', $this->getUnneededCommandLineUsers()),
-            true
-        );
-    }
-
-    /**
-     * @return string Unique identifier of this updater
-     */
-    public function getIdentifier(): string
-    {
-        return 'commandLineBackendUserRemovalUpdate';
-    }
-
-    /**
-     * @return string Title of this updater
-     */
-    public function getTitle(): string
-    {
-        return 'Remove unneeded CLI backend users';
-    }
-
-    /**
-     * @return string Longer description of this updater
-     */
-    public function getDescription(): string
-    {
-        return 'The command line interface does not need to have custom _cli_* backend users anymore.'
-               . ' They can safely be deleted.';
-    }
-
-    /**
-     * Checks if an update is needed
-     *
-     * @return bool Whether an update is needed (TRUE) or not (FALSE)
-     */
-    public function updateNecessary(): bool
-    {
-        $needsExecution = false;
-        $usersFound = $this->getUnneededCommandLineUsers();
-        if (!empty($usersFound)) {
-            $needsExecution = true;
-        }
-        return $needsExecution;
-    }
-
-    /**
-     * @param OutputInterface $output
-     */
-    public function setOutput(OutputInterface $output): void
-    {
-        $this->output = $output;
-    }
-
-    /**
-     * @return string[] All new fields and tables must exist
-     */
-    public function getPrerequisites(): array
-    {
-        return [
-            DatabaseUpdatedPrerequisite::class,
-        ];
-    }
-
-    /**
-     * Performs the database update to set all be_users starting with _CLI_* to deleted
-     *
-     * @return bool
-     */
-    public function executeUpdate(): bool
-    {
-        $usersFound = $this->getUnneededCommandLineUsers();
-        foreach ($usersFound as $userUid => $username) {
-            $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('be_users');
-            $queryBuilder->update('be_users')
-                ->where(
-                    $queryBuilder->expr()->eq(
-                        'uid',
-                        $queryBuilder->createNamedParameter($userUid, \PDO::PARAM_INT)
-                    )
-                )
-                // "false" is set as third parameter to have the final
-                // value in $databaseQueries and not a statement placeholder
-                ->set('deleted', 1, false)
-                ->execute();
-        }
-        $this->output->writeln('The following backend users have been deleted:');
-        foreach ($usersFound as $user) {
-            $this->output->writeln('* ' . $user);
-        }
-        return true;
-    }
-
-    /**
-     * Find all backend users starting with _CLI_ that are not deleted yet.
-     *
-     * @return array a list of uids
-     */
-    protected function getUnneededCommandLineUsers(): array
-    {
-        $commandLineUsers = [];
-
-        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
-            ->getQueryBuilderForTable('be_users');
-        $queryBuilder->getRestrictions()
-            ->removeAll()
-            ->add(GeneralUtility::makeInstance(DeletedRestriction::class));
-
-        $result = $queryBuilder
-            ->select('uid', 'username')
-            ->from('be_users')
-            ->where(
-            // Using query builder is complicated in this case. Get it straight, no user input is involved.
-                'LOWER(username) LIKE \'_cli_%\'',
-                $queryBuilder->expr()->neq(
-                    'username',
-                    $queryBuilder->createNamedParameter('_cli_', \PDO::PARAM_STR)
-                )
-            )
-            ->execute();
-
-        while ($row = $result->fetch()) {
-            $commandLineUsers[$row['uid']] = $row['username'];
-        }
-
-        return $commandLineUsers;
-    }
-
-    /**
-     * Return a confirmation message instance
-     *
-     * @return Confirmation
-     */
-    public function getConfirmation(): Confirmation
-    {
-        return $this->confirmation;
-    }
-}
diff --git a/typo3/sysext/install/Classes/Updates/Compatibility7ExtractionUpdate.php b/typo3/sysext/install/Classes/Updates/Compatibility7ExtractionUpdate.php
deleted file mode 100644 (file)
index 6639ce9..0000000
+++ /dev/null
@@ -1,138 +0,0 @@
-<?php
-namespace TYPO3\CMS\Install\Updates;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
-
-/**
- * Installs and downloads EXT:compatibility7 if needed
- * @internal This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.
- */
-class Compatibility7ExtractionUpdate extends AbstractDownloadExtensionUpdate
-{
-    /**
-     * @var string
-     */
-    protected $title = 'Install extension "compatibility7" from TER';
-
-    /**
-     * @var string
-     */
-    protected $extensionKey = 'compatibility7';
-
-    /**
-     * @var array
-     */
-    protected $extensionDetails = [
-        'compatibility7' => [
-            'title' => 'Compatibility Mode for TYPO3 v7',
-            'description' => 'Provides an additional backwards-compatibility layer with legacy functionality for sites that haven\'t fully migrated to TYPO3 v8 yet.',
-            'versionString' => '8.7.1',
-            'composerName' => 'friendsoftypo3/compatibility7',
-        ],
-    ];
-
-    /**
-     * @var \TYPO3\CMS\Install\Updates\ExtensionModel
-     */
-    protected $extension;
-
-    /**
-     * @var \TYPO3\CMS\Install\Updates\Confirmation
-     */
-    protected $confirmation;
-
-    public function __construct()
-    {
-        $this->extension = new ExtensionModel(
-            'compatibility7',
-            'Compatibility Mode for TYPO3 v7',
-            '8.7.1',
-            'friendsoftypo3/compatibility7',
-            'Provides an additional backwards-compatibility layer with legacy functionality for sites that haven\'t fully migrated to TYPO3 v8 yet.'
-        );
-
-        $this->confirmation = new Confirmation(
-            'Are you sure?',
-            'The compatibility extensions come with a performance penalty, use only if needed. ' . $this->extension->getDescription(),
-            false
-        );
-    }
-
-    /**
-     * Return a confirmation message instance
-     *
-     * @return \TYPO3\CMS\Install\Updates\Confirmation
-     */
-    public function getConfirmation(): Confirmation
-    {
-        return $this->confirmation;
-    }
-
-    /**
-     * Return the identifier for this wizard
-     * This should be the same string as used in the ext_localconf class registration
-     *
-     * @return string
-     */
-    public function getIdentifier(): string
-    {
-        return 'compatibility7Extension';
-    }
-
-    /**
-     * Return the speaking name of this wizard
-     *
-     * @return string
-     */
-    public function getTitle(): string
-    {
-        return 'Install compatibility extension for TYPO3 7 compatibility';
-    }
-
-    /**
-     * Return the description for this wizard
-     *
-     * @return string
-     */
-    public function getDescription(): string
-    {
-        return 'The extension "compatibility7" (Compatibility Mode for TYPO3 v7) was extracted into '
-               . 'the TYPO3 Extension Repository. This update downloads the TYPO3 Extension from the TER.';
-    }
-
-    /**
-     * Is an update necessary?
-     * Is used to determine whether a wizard needs to be run.
-     *
-     * @return bool
-     */
-    public function updateNecessary(): bool
-    {
-        return !ExtensionManagementUtility::isLoaded('compatibility7');
-    }
-
-    /**
-     * Returns an array of class names of Prerequisite classes
-     * This way a wizard can define dependencies like "database up-to-date" or
-     * "reference index updated"
-     *
-     * @return string[]
-     */
-    public function getPrerequisites(): array
-    {
-        return [];
-    }
-}
index 6c14dd9..c4fcfd1 100644 (file)
@@ -18,10 +18,7 @@ namespace TYPO3\CMS\Install\Updates;
 use TYPO3\CMS\Core\Database\ConnectionPool;
 use TYPO3\CMS\Core\Registry;
 use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Install\Updates\RowUpdater\ImageCropUpdater;
-use TYPO3\CMS\Install\Updates\RowUpdater\L10nModeUpdater;
 use TYPO3\CMS\Install\Updates\RowUpdater\RowUpdaterInterface;
-use TYPO3\CMS\Install\Updates\RowUpdater\RteLinkSyntaxUpdater;
 
 /**
  * This is a generic updater to migrate content of TCA rows.
@@ -47,9 +44,6 @@ class DatabaseRowsUpdateWizard implements UpgradeWizardInterface, RepeatableInte
      * @var array Single classes that may update rows
      */
     protected $rowUpdater = [
-        L10nModeUpdater::class,
-        ImageCropUpdater::class,
-        RteLinkSyntaxUpdater::class,
     ];
 
     /**
diff --git a/typo3/sysext/install/Classes/Updates/FileReferenceUpdate.php b/typo3/sysext/install/Classes/Updates/FileReferenceUpdate.php
deleted file mode 100644 (file)
index 817bcfc..0000000
+++ /dev/null
@@ -1,136 +0,0 @@
-<?php
-declare(strict_types = 1);
-namespace TYPO3\CMS\Install\Updates;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Database\ConnectionPool;
-use TYPO3\CMS\Core\Resource\Exception;
-use TYPO3\CMS\Core\Resource\File;
-use TYPO3\CMS\Core\Resource\ResourceFactory;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Core\Utility\MathUtility;
-
-/**
- * Migrate file references that are stored in a wrong way to correct scheme
- * @internal This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.
- */
-class FileReferenceUpdate implements UpgradeWizardInterface
-{
-    /**
-     * @return string Unique identifier of this updater
-     */
-    public function getIdentifier(): string
-    {
-        return 'fileReferenceUpdate';
-    }
-
-    /**
-     * @return string Title of this updater
-     */
-    public function getTitle(): string
-    {
-        return 'Migrate file references that are stored in a wrong way to correct scheme';
-    }
-
-    /**
-     * @return string Longer description of this updater
-     */
-    public function getDescription(): string
-    {
-        return 'File references were saved in a wrong way and references are not shown correctly in file list module.';
-    }
-
-    /**
-     * @return bool True if there are records to update
-     */
-    public function updateNecessary(): bool
-    {
-        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_refindex');
-        return (bool)$queryBuilder->count('hash')
-            ->from('sys_refindex')
-            ->where(
-                $queryBuilder->expr()->eq('ref_table', $queryBuilder->createNamedParameter('_FILE', \PDO::PARAM_STR)),
-                $queryBuilder->expr()->eq('softref_key', $queryBuilder->createNamedParameter('typolink_tag', \PDO::PARAM_STR)),
-                $queryBuilder->expr()->eq('deleted', $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT))
-            )
-            ->execute()
-            ->fetchColumn(0);
-    }
-
-    /**
-     * @return string[] All new fields and tables must exist
-     */
-    public function getPrerequisites(): array
-    {
-        return [
-            DatabaseUpdatedPrerequisite::class
-        ];
-    }
-
-    /**
-     * Performs the update
-     *
-     * @return bool
-     */
-    public function executeUpdate(): bool
-    {
-        $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('sys_refindex');
-        $queryBuilder = $connection->createQueryBuilder();
-        $statement = $queryBuilder->select('*')
-            ->from('sys_refindex')
-            ->where(
-                $queryBuilder->expr()->eq('ref_table', $queryBuilder->createNamedParameter('_FILE', \PDO::PARAM_STR)),
-                $queryBuilder->expr()->eq('softref_key', $queryBuilder->createNamedParameter('typolink_tag', \PDO::PARAM_STR)),
-                $queryBuilder->expr()->eq('deleted', $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT))
-            )
-            ->execute();
-        while ($record = $statement->fetch()) {
-            $fileReference = 0;
-            if (MathUtility::canBeInterpretedAsInteger($record['ref_string'])) {
-                $fileReference = $record['ref_string'];
-            } else {
-                try {
-                    $fileObject = ResourceFactory::getInstance()->retrieveFileOrFolderObject($record['ref_string']);
-                    if ($fileObject instanceof File) {
-                        $fileReference = $fileObject->getUid();
-                    }
-                } catch (Exception $e) {
-                    // Silently catch if there is no file object
-                }
-            }
-
-            $updateQueryBuilder = $connection->createQueryBuilder();
-            $updateQueryBuilder->update('sys_refindex')
-                ->where(
-                    $updateQueryBuilder->expr()->eq(
-                        'hash',
-                        $updateQueryBuilder->createNamedParameter($record['hash'], \PDO::PARAM_STR)
-                    )
-                );
-
-            if ($fileReference) {
-                $updateQueryBuilder->set('ref_table', 'sys_file')
-                    ->set('ref_uid', $fileReference)
-                    ->set('ref_string', '');
-            } else {
-                $updateQueryBuilder->set('deleted', 1);
-            }
-
-            $updateQueryBuilder->execute();
-        }
-
-        return true;
-    }
-}
diff --git a/typo3/sysext/install/Classes/Updates/FillTranslationSourceField.php b/typo3/sysext/install/Classes/Updates/FillTranslationSourceField.php
deleted file mode 100644 (file)
index 92718d3..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-<?php
-namespace TYPO3\CMS\Install\Updates;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Database\ConnectionPool;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-
-/**
- * Fill translation source field (l10n_source)
- * @internal This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.
- */
-class FillTranslationSourceField implements UpgradeWizardInterface
-{
-    /**
-     * @return string Unique identifier of this updater
-     */
-    public function getIdentifier(): string
-    {
-        return 'fillTranslationSourceField';
-    }
-
-    /**
-     * @return string Title of this updater
-     */
-    public function getTitle(): string
-    {
-        return 'Fill translation source field (l10n_source)';
-    }
-
-    /**
-     * @return string Longer description of this updater
-     */
-    public function getDescription(): string
-    {
-        return 'Fill translation source field (l10n_source) for tt_contents which have l18n_parent set.';
-    }
-
-    /**
-     * Checks if an update is needed
-     *
-     * @return bool Whether an update is needed (TRUE) or not (FALSE)
-     */
-    public function updateNecessary(): bool
-    {
-        $connection = GeneralUtility::makeInstance(ConnectionPool::class)
-            ->getConnectionForTable('tt_content');
-        $queryBuilder = $connection->createQueryBuilder();
-        $queryBuilder->getRestrictions()->removeAll();
-        $query = $queryBuilder->count('uid')
-            ->from('tt_content')
-            ->where($queryBuilder->expr()->andX(
-                $queryBuilder->expr()->gt('l18n_parent', $queryBuilder->createNamedParameter(0)),
-                $queryBuilder->expr()->eq('l10n_source', $queryBuilder->createNamedParameter(0))
-            ));
-        return (bool)$query->execute()->fetchColumn(0);
-    }
-
-    /**
-     * @return string[] All new fields and tables must exist
-     */
-    public function getPrerequisites(): array
-    {
-        return [
-            DatabaseUpdatedPrerequisite::class
-        ];
-    }
-
-    /**
-     * Performs the database update
-     *
-     * @return bool
-     */
-    public function executeUpdate(): bool
-    {
-        $connection = GeneralUtility::makeInstance(ConnectionPool::class)
-            ->getConnectionForTable('tt_content');
-        $queryBuilder = $connection->createQueryBuilder();
-        $queryBuilder->getRestrictions()->removeAll();
-        $queryBuilder->update('tt_content', 't')
-            ->set('t.l10n_source', 't.l18n_parent', false)
-            ->where($queryBuilder->expr()->andX(
-                $queryBuilder->expr()->gt('t.l18n_parent', $queryBuilder->createNamedParameter(0)),
-                $queryBuilder->expr()->eq('t.l10n_source', $queryBuilder->createNamedParameter(0))
-            ))
-            ->execute();
-        return true;
-    }
-}
diff --git a/typo3/sysext/install/Classes/Updates/FormLegacyExtractionUpdate.php b/typo3/sysext/install/Classes/Updates/FormLegacyExtractionUpdate.php
deleted file mode 100644 (file)
index 552d191..0000000
+++ /dev/null
@@ -1,134 +0,0 @@
-<?php
-namespace TYPO3\CMS\Install\Updates;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Database\ConnectionPool;
-use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
-use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-
-/**
- * Installs and downloads EXT:form_legacy if needed
- * @internal This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.
- */
-class FormLegacyExtractionUpdate extends AbstractDownloadExtensionUpdate
-{
-    /**
-     * @var \TYPO3\CMS\Install\Updates\Confirmation
-     */
-    protected $confirmation;
-
-    public function __construct()
-    {
-        $this->extension = new ExtensionModel(
-            'form_legacy',
-            'Legacy form extension for TYPO3 v7 compatibility',
-            '8.7.0',
-            'friendsoftypo3/form-legacy',
-            'Provides an additional backwards-compatibility layer with legacy functionality for sites that used the form extension in TYPO3 v7.'
-        );
-
-        $this->confirmation = new Confirmation(
-            'Are you really sure, you want to install EXT:form_legacy?',
-            'You should install EXT:form_legacy only if you really need it.'
-                    . 'This update wizard checked all content elements and found at least one not deleted element based'
-                    . 'on the old form module. It is advised to manually convert those elements from the old form implementation'
-                    . 'to the new implementation of EXT:form. EXT:form_legacy should be unloaded and removed afterwards.',
-            true
-        );
-    }
-
-    /**
-     * Return a confirmation message instance
-     *
-     * @return \TYPO3\CMS\Install\Updates\Confirmation
-     */
-    public function getConfirmation(): Confirmation
-    {
-        return $this->confirmation;
-    }
-
-    /**
-     * Return the identifier for this wizard
-     * This should be the same string as used in the ext_localconf class registration
-     *
-     * @return string
-     */
-    public function getIdentifier(): string
-    {
-        return 'formLegacyExtractionUpdate';
-    }
-
-    /**
-     * Return the speaking name of this wizard
-     *
-     * @return string
-     */
-    public function getTitle(): string
-    {
-        return 'Install extension "form_legacy"';
-    }
-
-    /**
-     * Return the description for this wizard
-     *
-     * @return string
-     */
-    public function getDescription(): string
-    {
-        return 'The extension "form" was rewritten in TYPO3 v8 and follows a new approach.'
-        . 'This update downloads the old implementation of the form extension as known from TYPO3 v7 from the TER.';
-    }
-
-    /**
-     * Is an update necessary?
-     * Is used to determine whether a wizard needs to be run.
-     *
-     * @return bool
-     */
-    public function updateNecessary(): bool
-    {
-        $updateNeeded = false;
-
-        if (!ExtensionManagementUtility::isLoaded('form_legacy')) {
-            $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tt_content');
-            $queryBuilder->getRestrictions()->removeAll()->add(GeneralUtility::makeInstance(DeletedRestriction::class));
-            $count = $queryBuilder
-                ->count('*')
-                ->from('tt_content')
-                ->where($queryBuilder->expr()->eq('CType', $queryBuilder->createNamedParameter('mailform')))
-                ->execute()
-                ->fetchColumn(0);
-            if ($count > 0) {
-                $updateNeeded = true;
-            }
-        }
-        return $updateNeeded;
-    }
-
-    /**
-     * Returns an array of class names of Prerequisite classes
-     * This way a wizard can define dependencies like "database up-to-date" or
-     * "reference index updated"
-     *
-     * @return string[]
-     */
-    public function getPrerequisites(): array
-    {
-        return [
-            DatabaseUpdatedPrerequisite::class
-        ];
-    }
-}
diff --git a/typo3/sysext/install/Classes/Updates/FrontendUserImageUpdateWizard.php b/typo3/sysext/install/Classes/Updates/FrontendUserImageUpdateWizard.php
deleted file mode 100644 (file)
index 44bc953..0000000
+++ /dev/null
@@ -1,333 +0,0 @@
-<?php
-namespace TYPO3\CMS\Install\Updates;
-
-/**
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-use Doctrine\DBAL\DBALException;
-use Psr\Log\LoggerAwareInterface;
-use Psr\Log\LoggerAwareTrait;
-use TYPO3\CMS\Core\Core\Environment;
-use TYPO3\CMS\Core\Database\ConnectionPool;
-use TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder;
-use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
-use TYPO3\CMS\Core\Registry;
-use TYPO3\CMS\Core\Resource\File;
-use TYPO3\CMS\Core\Resource\ResourceStorage;
-use TYPO3\CMS\Core\Resource\StorageRepository;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Core\Utility\PathUtility;
-
-/**
- * Upgrade wizard which goes through all files referenced in fe_users::image
- * and creates sys_file records as well as sys_file_reference records for each hit.
- * @internal This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.
- */
-class FrontendUserImageUpdateWizard implements UpgradeWizardInterface, LoggerAwareInterface
-{
-    use LoggerAwareTrait;
-
-    /**
-     * Number of records fetched per database query
-     * Used to prevent memory overflows for huge databases
-     */
-    const RECORDS_PER_QUERY = 1000;
-
-    /**
-     * @var ResourceStorage
-     */
-    protected $storage;
-
-    /**
-     * Table to migrate records from
-     *
-     * @var string
-     */
-    protected $table = 'fe_users';
-
-    /**
-     * Table field holding the migration to be
-     *
-     * @var string
-     */
-    protected $fieldToMigrate = 'image';
-
-    /**
-     * the source file resides here
-     *
-     * @var string
-     */
-    protected $sourcePath = 'uploads/pics/';
-
-    /**
-     * target folder after migration
-     * Relative to fileadmin
-     *
-     * @var string
-     */
-    protected $targetPath = '_migrated/frontend_users/';
-
-    /**
-     * @var Registry
-     */
-    protected $registry;
-
-    /**
-     * @var string
-     */
-    protected $registryNamespace = 'FrontendUserImageUpdateWizard';
-
-    /**
-     * @var array
-     */
-    protected $recordOffset = [];
-
-    /**
-     * @return string Unique identifier of this updater
-     */
-    public function getIdentifier(): string
-    {
-        return 'frontendUserImageUpdateWizard';
-    }
-
-    /**
-     * @return string Title of this updater
-     */
-    public function getTitle(): string
-    {
-        return 'Migrate all file relations from fe_users.image to sys_file_references';
-    }
-
-    /**
-     * @return string Longer description of this updater
-     */
-    public function getDescription(): string
-    {
-        return 'This update wizard goes through all files that are referenced in the fe_users.image'
-            . ' field and adds the files to the FAL File Index. It also moves the files from'
-            . ' uploads/ to the fileadmin/_migrated/ path.';
-    }
-
-    /**
-     * Checks if an update is needed
-     *
-     * @return bool TRUE if an update is needed, FALSE otherwise
-     */
-    public function updateNecessary(): bool
-    {
-        $this->registry = GeneralUtility::makeInstance(Registry::class);
-        return $this->registry->get($this->registryNamespace, 'recordOffset') === null;
-    }
-
-    /**
-     * @return string[] All new fields and tables must exist
-     */
-    public function getPrerequisites(): array
-    {
-        return [
-            DatabaseUpdatedPrerequisite::class
-        ];
-    }
-
-    /**
-     * Performs the database update.
-     *
-     * @return bool TRUE on success, FALSE on error
-     */
-    public function executeUpdate(): bool
-    {
-        try {
-            $this->init();
-            if (!isset($this->recordOffset[$this->table])) {
-                $this->recordOffset[$this->table] = 0;
-            }
-            do {
-                $limit = $this->recordOffset[$this->table] . ',' . self::RECORDS_PER_QUERY;
-                $records = $this->getRecordsFromTable($limit);
-                foreach ($records as $record) {
-                    $this->migrateField($record);
-                }
-                $this->registry->set($this->registryNamespace, 'recordOffset', $this->recordOffset);
-            } while (count($records) === self::RECORDS_PER_QUERY);
-
-            $this->registry->remove($this->registryNamespace, 'recordOffset');
-        } catch (\Exception $e) {
-            // Silently catch db errors
-        }
-        return true;
-    }
-
-    /**
-     * Initialize the storage repository.
-     */
-    protected function init()
-    {
-        $storages = GeneralUtility::makeInstance(StorageRepository::class)->findAll();
-        $this->storage = $storages[0];
-        $this->registry = GeneralUtility::makeInstance(Registry::class);
-        $this->recordOffset = $this->registry->get($this->registryNamespace, 'recordOffset', []);
-    }
-
-    /**
-     * Get records from table where the field to migrate is not empty (NOT NULL and != '')
-     * and also not numeric (which means that it is migrated)
-     *
-     * @param int $limit Maximum number records to select
-     * @return array
-     * @throws \RuntimeException
-     */
-    protected function getRecordsFromTable($limit)
-    {
-        $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
-        $queryBuilder = $connectionPool->getQueryBuilderForTable($this->table);
-        $queryBuilder->getRestrictions()
-            ->removeAll()
-            ->add(GeneralUtility::makeInstance(DeletedRestriction::class));
-        try {
-            return $queryBuilder
-                ->select('uid', 'pid', $this->fieldToMigrate)
-                ->from($this->table)
-                ->where(
-                    $queryBuilder->expr()->isNotNull($this->fieldToMigrate),
-                    $queryBuilder->expr()->neq(
-                        $this->fieldToMigrate,
-                        $queryBuilder->createNamedParameter('', \PDO::PARAM_STR)
-                    ),
-                    $queryBuilder->expr()->comparison(
-                        'CAST(CAST(' . $queryBuilder->quoteIdentifier($this->fieldToMigrate) . ' AS DECIMAL) AS CHAR)',
-                        ExpressionBuilder::NEQ,
-                        'CAST(' . $queryBuilder->quoteIdentifier($this->fieldToMigrate) . ' AS CHAR)'
-                    )
-                )
-                ->orderBy('uid')
-                ->setFirstResult($limit)
-                ->execute()
-                ->fetchAll();
-        } catch (DBALException $e) {
-            throw new \RuntimeException(
-                'Database query failed. Error was: ' . $e->getPrevious()->getMessage(),
-                1476050084
-            );
-        }
-    }
-
-    /**
-     * Migrates a single field.
-     *
-     * @param array $row
-     */
-    protected function migrateField($row)
-    {
-        $fieldItems = GeneralUtility::trimExplode(',', $row[$this->fieldToMigrate], true);
-        if (empty($fieldItems) || is_numeric($row[$this->fieldToMigrate])) {
-            return;
-        }
-        $fileadminDirectory = rtrim($GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'], '/') . '/';
-        $i = 0;
-
-        $storageUid = (int)$this->storage->getUid();
-
-        $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
-
-        foreach ($fieldItems as $item) {
-            $fileUid = null;
-            $sourcePath = Environment::getPublicPath() . '/' . $this->sourcePath . $item;
-            $targetDirectory = Environment::getPublicPath() . '/' . $fileadminDirectory . $this->targetPath;
-            $targetPath = $targetDirectory . PathUtility::basename($item);
-
-            // maybe the file was already moved, so check if the original file still exists
-            if (file_exists($sourcePath)) {
-                if (!is_dir($targetDirectory)) {
-                    GeneralUtility::mkdir_deep($targetDirectory);
-                }
-
-                // see if the file already exists in the storage
-                $fileSha1 = sha1_file($sourcePath);
-
-                $queryBuilder = $connectionPool->getQueryBuilderForTable('sys_file');
-                $queryBuilder->getRestrictions()->removeAll();
-                $existingFileRecord = $queryBuilder->select('uid')->from('sys_file')->where(
-                    $queryBuilder->expr()->eq(
-                        'sha1',
-                        $queryBuilder->createNamedParameter($fileSha1, \PDO::PARAM_STR)
-                    ),
-                    $queryBuilder->expr()->eq(
-                        'storage',
-                        $queryBuilder->createNamedParameter($storageUid, \PDO::PARAM_INT)
-                    )
-                )->execute()->fetch();
-
-                // the file exists, the file does not have to be moved again
-                if (is_array($existingFileRecord)) {
-                    $fileUid = $existingFileRecord['uid'];
-                } else {
-                    // just move the file (no duplicate)
-                    rename($sourcePath, $targetPath);
-                }
-            }
-
-            if ($fileUid === null) {
-                // get the File object if it hasn't been fetched before
-                try {
-                    // if the source file does not exist, we should just continue, but leave a message in the docs;
-                    // ideally, the user would be informed after the update as well.
-                    /** @var File $file */
-                    $file = $this->storage->getFile($this->targetPath . $item);
-                    $fileUid = $file->getUid();
-                } catch (\InvalidArgumentException $e) {
-                    // no file found, no reference can be set
-                    $this->logger->notice(
-                        'File ' . $this->sourcePath . $item . ' does not exist. Reference was not migrated.',
-                        [
-                            'table' => $this->table,
-                            'record' => $row,
-                            'field' => $this->fieldToMigrate,
-                        ]
-                    );
-                    continue;
-                }
-            }
-
-            if ($fileUid > 0) {
-                $fields = [
-                    'fieldname' => $this->fieldToMigrate,
-                    'table_local' => 'sys_file',
-                    'pid' => $this->table === 'pages' ? $row['uid'] : $row['pid'],
-                    'uid_foreign' => $row['uid'],
-                    'uid_local' => $fileUid,
-                    'tablenames' => $this->table,
-                    'crdate' => time(),
-                    'tstamp' => time(),
-                    'sorting_foreign' => $i,
-                ];
-
-                $queryBuilder = $connectionPool->getQueryBuilderForTable('sys_file_reference');
-                $queryBuilder->insert('sys_file_reference')->values($fields)->execute();
-                ++$i;
-            }
-        }
-
-        // Update referencing table's original field to now contain the count of references,
-        // but only if all new references could be set
-        if ($i === count($fieldItems)) {
-            $queryBuilder = $connectionPool->getQueryBuilderForTable($this->table);
-            $queryBuilder->update($this->table)->where(
-                $queryBuilder->expr()->eq(
-                    'uid',
-                    $queryBuilder->createNamedParameter($row['uid'], \PDO::PARAM_INT)
-                )
-            )->set($this->fieldToMigrate, $i)->execute();
-        } else {
-            $this->recordOffset[$this->table]++;
-        }
-    }
-}
diff --git a/typo3/sysext/install/Classes/Updates/LanguageSortingUpdate.php b/typo3/sysext/install/Classes/Updates/LanguageSortingUpdate.php
deleted file mode 100644 (file)
index 0a4c5cc..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-<?php
-declare(strict_types = 1);
-namespace TYPO3\CMS\Install\Updates;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Database\ConnectionPool;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-
-/**
- * Update sys_language records to use the newly sorting column,
- * set default sorting from title
- * @internal This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.
- */
-class LanguageSortingUpdate implements UpgradeWizardInterface
-{
-    /**
-     * @return string Unique identifier of this updater
-     */
-    public function getIdentifier(): string
-    {
-        return 'sysLanguageSorting';
-    }
-
-    /**
-     * @return string Title of this updater
-     */
-    public function getTitle(): string
-    {
-        return 'Update sorting of sys_language records';
-    }
-
-    /**
-     * @return string Longer description of this updater
-     */
-    public function getDescription(): string
-    {
-        return 'The sys_language records have unsorted rows. '
-            . ' This upgrade wizard adds values depending on the language title';
-    }
-
-    /**
-     * Checks if an update is needed
-     *
-     * @return bool Whether an update is needed (TRUE) or not (FALSE)
-     */
-    public function updateNecessary(): bool
-    {
-        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
-            ->getQueryBuilderForTable('sys_language');
-        return (bool)$queryBuilder->count('uid')
-            ->from('sys_language')
-            ->where(
-                $queryBuilder->expr()->eq('sorting', $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)),
-                $queryBuilder->expr()->isNotNull('sorting')
-            )
-            ->execute()
-            ->fetchColumn(0);
-    }
-
-    /**
-     * @return string[] All new fields and tables must exist
-     */
-    public function getPrerequisites(): array
-    {
-        return [
-            DatabaseUpdatedPrerequisite::class
-        ];
-    }
-
-    /**
-     * Performs the database update if the sorting field is 0 or null
-     *
-     * @return bool
-     */
-    public function executeUpdate(): bool
-    {
-        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
-            ->getQueryBuilderForTable('sys_language');
-        $statement = $queryBuilder->select('uid')
-            ->from('sys_language')
-            ->where(
-                $queryBuilder->expr()->eq('sorting', $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT))
-            )
-            ->orderBy('title')
-            ->execute();
-        $sortCounter = 128;
-        while ($languageRecord = $statement->fetch()) {
-            $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
-                ->getQueryBuilderForTable('sys_language');
-            $queryBuilder->update('sys_language')
-                ->where(
-                    $queryBuilder->expr()->eq(
-                        'uid',
-                        $queryBuilder->createNamedParameter($languageRecord['uid'], \PDO::PARAM_INT)
-                    )
-                )
-                ->set('sorting', $sortCounter)
-                ->execute();
-            $sortCounter *= 2;
-        }
-        return true;
-    }
-}
diff --git a/typo3/sysext/install/Classes/Updates/MigrateFeSessionDataUpdate.php b/typo3/sysext/install/Classes/Updates/MigrateFeSessionDataUpdate.php
deleted file mode 100644 (file)
index 1da97f8..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-<?php
-declare(strict_types = 1);
-namespace TYPO3\CMS\Install\Updates;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use Doctrine\DBAL\DBALException;
-use TYPO3\CMS\Core\Database\ConnectionPool;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-
-/**
- * Merge sessions from old fe_session_data table into new structure from fe_sessions
- * @internal This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.
- */
-class MigrateFeSessionDataUpdate implements UpgradeWizardInterface
-{
-    /**
-     * @return string Unique identifier of this updater
-     */
-    public function getIdentifier(): string
-    {
-        return 'migrateFeSessionDataUpdate';
-    }
-
-    /**
-     * @return string Title of this updater
-     */
-    public function getTitle(): string
-    {
-        return 'Migrates existing fe_session_data into fe_sessions';
-    }
-
-    /**
-     * @return string Longer description of this updater
-     */
-    public function getDescription(): string
-    {
-        return 'With the new Session Framwework the session data is stored in fe_sessions.'
-            . ' To avoid that data is truncated, ensure the columns of fe_sessions have been updated.'
-            . ' This wizard migrates the existing data from fe_session_data into fe_sessions.'
-            . ' Existing entries in fe_sessions having an entry in fe_session_data are updated.'
-            . ' Entries in fe_session_data not found in fe_sessions are inserted with ses_anonymous = true';
-    }
-
-    /**
-     * Checks if an update is needed
-     *
-     * @return bool Whether an update is needed (true) or not (false)
-     */
-    public function updateNecessary(): bool
-    {
-        if (!$this->checkIfTableExists('fe_session_data')) {
-            return false;
-        }
-        // Check if there is data to migrate
-        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
-            ->getQueryBuilderForTable('fe_session_data');
-        $queryBuilder->getRestrictions()->removeAll();
-        $count = $queryBuilder->count('*')
-            ->from('fe_session_data')
-            ->execute()
-            ->fetchColumn(0);
-
-        return $count > 0;
-    }
-
-    /**
-     * @return string[] All new fields and tables must exist
-     */
-    public function getPrerequisites(): array
-    {
-        return [
-            DatabaseUpdatedPrerequisite::class
-        ];
-    }
-
-    /**
-     * Moves data from fe_session_data into fe_sessions with respect to ses_anonymous
-     *
-     * @return bool
-     */
-    public function executeUpdate(): bool
-    {
-        $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('fe_sessions');
-
-        // Process records that have entries in fe_sessions and fe_session_data
-        $queryBuilder = $connection->createQueryBuilder();
-        $statement = $queryBuilder->select('fe_session_data.hash', 'fe_session_data.content')
-            ->from('fe_sessions')
-            ->join(
-                'fe_sessions',
-                'fe_session_data',
-                'fe_session_data',
-                $queryBuilder->expr()->eq(
-                    'fe_sessions.ses_id',
-                    $queryBuilder->quoteIdentifier('fe_session_data.hash')
-                )
-            )
-            ->execute();
-
-        $updateQueryBuilder = $connection->createQueryBuilder();
-        $updateQueryBuilder->update('fe_sessions')
-            ->where(
-                $updateQueryBuilder->expr()->eq(
-                    'ses_id',
-                    $updateQueryBuilder->createPositionalParameter('', \PDO::PARAM_STR)
-                )
-            )
-            ->set('ses_data', $updateQueryBuilder->createPositionalParameter('', \PDO::PARAM_STR), false);
-        $updateStatement = $connection->prepare($updateQueryBuilder->getSQL());
-
-        $connection->beginTransaction();
-        try {
-            while ($row = $statement->fetch()) {
-                $updateStatement->execute([$row['hash'], $row['content']]);
-            }
-            $connection->commit();
-        } catch (DBALException $e) {
-            $connection->rollBack();
-            throw $e;
-        }
-
-        // Move records from fe_session_data that are not in fe_sessions
-        $queryBuilder = $connection->createQueryBuilder();
-        $selectSQL = $queryBuilder->select('fe_session_data.hash', 'fe_session_data.content', 'fe_session_data.tstamp')
-            ->addSelectLiteral('1')
-            ->from('fe_session_data')
-            ->leftJoin(
-                'fe_session_data',
-                'fe_sessions',
-                'fe_sessions',
-                $queryBuilder->expr()->eq(
-                    'fe_session_data.hash',
-                    $queryBuilder->quoteIdentifier('fe_sessions.ses_id')
-                )
-            )
-            ->where($queryBuilder->expr()->isNull('fe_sessions.ses_id'))
-            ->getSQL();
-
-        $insertSQL = sprintf(
-            'INSERT INTO %s(%s, %s, %s, %s) %s',
-            $connection->quoteIdentifier('fe_sessions'),
-            $connection->quoteIdentifier('ses_id'),
-            $connection->quoteIdentifier('ses_data'),
-            $connection->quoteIdentifier('ses_tstamp'),
-            $connection->quoteIdentifier('ses_anonymous'),
-            $selectSQL
-        );
-
-        try {
-            $connection->beginTransaction();
-            $connection->exec($insertSQL);
-            $connection->commit();
-        } catch (DBALException $e) {
-            $connection->rollBack();
-            throw $e;
-        }
-
-        return true;
-    }
-
-    /**
-     * Check if given table exists
-     *
-     * @param string $table
-     * @return bool
-     */
-    protected function checkIfTableExists($table): bool
-    {
-        $tableExists = GeneralUtility::makeInstance(ConnectionPool::class)
-            ->getConnectionForTable($table)
-            ->getSchemaManager()
-            ->tablesExist([$table]);
-
-        return $tableExists;
-    }
-}
diff --git a/typo3/sysext/install/Classes/Updates/MigrateFscStaticTemplateUpdate.php b/typo3/sysext/install/Classes/Updates/MigrateFscStaticTemplateUpdate.php
deleted file mode 100644 (file)
index a3514c7..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-<?php
-namespace TYPO3\CMS\Install\Updates;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Database\ConnectionPool;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-
-/**
- * Migrate "fluid_styled_content" static template location
- * @internal This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.
- */
-class MigrateFscStaticTemplateUpdate implements UpgradeWizardInterface
-{
-    /**
-     * @return string Unique identifier of this updater
-     */
-    public function getIdentifier(): string
-    {
-        return 'migrateFscStaticTemplateUpdate';
-    }
-
-    /**
-     * @return string Title of this updater
-     */
-    public function getTitle(): string
-    {
-        return 'Migrate "fluid_styled_content" static template location';
-    }
-
-    /**
-     * @return string Longer description of this updater
-     */
-    public function getDescription(): string
-    {
-        return 'Static templates have been relocated to EXT:fluid_styled_content/Configuration/TypoScript/';
-    }
-
-    /**
-     * Checks if an update is needed
-     *
-     * @return bool Whether an update is needed (TRUE) or not (FALSE)
-     */
-    public function updateNecessary(): bool
-    {
-        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('sys_template');
-        $queryBuilder->getRestrictions()->removeAll();
-        $elementCount = $queryBuilder->count('uid')
-            ->from('sys_template')
-            ->where(
-                $queryBuilder->expr()->orX(
-                    $queryBuilder->expr()->like(
-                        'constants',
-                        $queryBuilder->createNamedParameter('%EXT:fluid_styled_content/Configuration/TypoScript/Static%', \PDO::PARAM_STR)
-                    ),
-                    $queryBuilder->expr()->like(
-                        'config',
-                        $queryBuilder->createNamedParameter('%EXT:fluid_styled_content/Configuration/TypoScript/Static%', \PDO::PARAM_STR)
-                    ),
-                    $queryBuilder->expr()->like(
-                        'include_static_file',
-                        $queryBuilder->createNamedParameter('%EXT:fluid_styled_content/Configuration/TypoScript/Static%', \PDO::PARAM_STR)
-                    )
-                )
-            )
-            ->execute()->fetchColumn(0);
-        return (bool)$elementCount;
-    }
-
-    /**
-     * @return string[] All new fields and tables must exist
-     */
-    public function getPrerequisites(): array
-    {
-        return [
-            DatabaseUpdatedPrerequisite::class
-        ];
-    }
-
-    /**
-     * Performs the database update
-     *
-     * @return bool
-     */
-    public function executeUpdate(): bool
-    {
-        $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('sys_template');
-        $queryBuilder = $connection->createQueryBuilder();
-        $queryBuilder->getRestrictions()->removeAll();
-        $statement = $queryBuilder->select('uid', 'include_static_file', 'constants', 'config')
-            ->from('sys_template')
-            ->where(
-                $queryBuilder->expr()->orX(
-                    $queryBuilder->expr()->like(
-                        'constants',
-                        $queryBuilder->createNamedParameter('%EXT:fluid_styled_content/Configuration/TypoScript/Static%', \PDO::PARAM_STR)
-                    ),
-                    $queryBuilder->expr()->like(
-                        'config',
-                        $queryBuilder->createNamedParameter('%EXT:fluid_styled_content/Configuration/TypoScript/Static%', \PDO::PARAM_STR)
-                    ),
-                    $queryBuilder->expr()->like(
-                        'include_static_file',
-                        $queryBuilder->createNamedParameter('%EXT:fluid_styled_content/Configuration/TypoScript/Static%', \PDO::PARAM_STR)
-                    )
-                )
-            )
-            ->execute();
-        while ($record = $statement->fetch()) {
-            $search = 'EXT:fluid_styled_content/Configuration/TypoScript/Static';
-            $replace = 'EXT:fluid_styled_content/Configuration/TypoScript';
-            $record['include_static_file'] = str_replace($search, $replace, $record['include_static_file']);
-            $record['constants'] = str_replace($search, $replace, $record['constants']);
-            $record['config'] = str_replace($search, $replace, $record['config']);
-            $queryBuilder = $connection->createQueryBuilder();
-            $queryBuilder->update('sys_template')
-                ->where(
-                    $queryBuilder->expr()->eq(
-                        'uid',
-                        $queryBuilder->createNamedParameter($record['uid'], \PDO::PARAM_INT)
-                    )
-                )
-                ->set('include_static_file', $record['include_static_file'])
-                ->set('constants', $record['constants'])
-                ->set('config', $record['config']);
-            $queryBuilder->execute();
-        }
-        return true;
-    }
-}
diff --git a/typo3/sysext/install/Classes/Updates/RowUpdater/ImageCropUpdater.php b/typo3/sysext/install/Classes/Updates/RowUpdater/ImageCropUpdater.php
deleted file mode 100644 (file)
index 26c090d..0000000
+++ /dev/null
@@ -1,207 +0,0 @@
-<?php
-declare(strict_types = 1);
-namespace TYPO3\CMS\Install\Updates\RowUpdater;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Database\ConnectionPool;
-use TYPO3\CMS\Core\Imaging\ImageManipulation\Area;
-use TYPO3\CMS\Core\Resource\Exception\FileDoesNotExistException;
-use TYPO3\CMS\Core\Resource\ResourceFactory;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Core\Utility\MathUtility;
-
-/**
- * Migrate values for database records having columns
- * using "l10n_mode" set to "mergeIfNotBlank".
- * @internal This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.
- */
-class ImageCropUpdater implements RowUpdaterInterface
-{
-    /**
-     * List of tables with information about to migrate fields.
-     * Created during hasPotentialUpdateForTable(), used in updateTableRow()
-     *
-     * @var array
-     */
-    protected $payload = [];
-
-    /**
-     * Get title
-     *
-     * @return string
-     */
-    public function getTitle(): string
-    {
-        return 'Migrate values in sys_file_reference crop field';
-    }
-
-    /**
-     * Return true if a table needs modifications.
-     *
-     * @param string $tableName Table name to check
-     * @return bool True if this table has fields to migrate
-     */
-    public function hasPotentialUpdateForTable(string $tableName): bool
-    {
-        $result = false;
-        $payload = $this->getPayloadForTable($tableName);
-        if (count($payload) !== 0) {
-            $this->payload[$tableName] = $payload;
-            $result = true;
-        }
-        return $result;
-    }
-
-    /**
-     * Update single row if needed
-     *
-     * @param string $tableName
-     * @param array $inputRow Given row data
-     * @return array Modified row data
-     */
-    public function updateTableRow(string $tableName, array $inputRow): array
-    {
-        $tablePayload = $this->payload[$tableName];
-
-        foreach ($tablePayload['fields'] as $field) {
-            if (strpos($inputRow[$field], '{"x":') === 0) {
-                $cropArray = json_decode($inputRow[$field], true);
-                if (is_array($cropArray)) {
-                    $file = $this->getFile($inputRow, $tablePayload['fileReferenceField'] ?: 'uid_local');
-                    if (null === $file) {
-                        continue;
-                    }
-
-                    $cropArea = Area::createFromConfiguration(json_decode($inputRow[$field], true));
-                    $cropVariantCollectionConfig = [
-                        'default' => [
-                            'cropArea' => $cropArea->makeRelativeBasedOnFile($file)->asArray(),
-                        ]
-                    ];
-                    $inputRow[$field] = json_encode($cropVariantCollectionConfig);
-                }
-            }
-        }
-
-        return $inputRow;
-    }
-
-    /**
-     * Retrieves field names grouped per table name having "l10n_mode" set
-     * to a relevant value that shall be migrated in database records.
-     *
-     * Resulting array is structured like this:
-     * + fields: [field a, field b, ...]
-     * + sources
-     *   + source uid: [localization uid, localization uid, ...]
-     *
-     * @param string $tableName Table name
-     * @return array Payload information for this table
-     * @throws \RuntimeException
-     */
-    protected function getPayloadForTable(string $tableName): array
-    {
-        if (!is_array($GLOBALS['TCA'][$tableName])) {
-            throw new \RuntimeException(
-                'Globals TCA of given table name must exist',
-                1485386982
-            );
-        }
-        $tableDefinition = $GLOBALS['TCA'][$tableName];
-
-        if (
-            empty($tableDefinition['columns'])
-            || !is_array($tableDefinition['columns'])
-        ) {
-            return [];
-        }
-
-        $fields = [];
-        $fileReferenceField = null;
-        foreach ($tableDefinition['columns'] as $fieldName => $fieldConfiguration) {
-            if (
-                !empty($fieldConfiguration['config']['type'])
-                && $fieldConfiguration['config']['type'] === 'group'
-                && !empty($fieldConfiguration['config']['internal_type'])
-                && $fieldConfiguration['config']['internal_type'] === 'db'
-                && !empty($fieldConfiguration['config']['allowed'])
-                && $fieldConfiguration['config']['allowed'] === 'sys_file'
-            ) {
-                $fileReferenceField = $fieldName;
-            }
-            if (
-                !empty($fieldConfiguration['config']['type'])
-                && $fieldConfiguration['config']['type'] === 'imageManipulation'
-            ) {
-                $fields[] = $fieldName;
-            }
-        }
-
-        if (empty($fields)) {
-            return [];
-        }
-
-        $payload = [];
-        $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
-
-        foreach ($fields as $fieldName) {
-            $queryBuilder = $connectionPool->getQueryBuilderForTable($tableName);
-            $queryBuilder->getRestrictions()->removeAll();
-
-            $query = $queryBuilder
-                ->from($tableName)
-                ->count($fieldName)
-                ->where(
-                    $queryBuilder->expr()->like(
-                        $fieldName,
-                        $queryBuilder->createNamedParameter('{"x":%', \PDO::PARAM_STR)
-                    )
-                );
-            if ((int)$query->execute()->fetchColumn(0) > 0) {
-                $payload['fields'][] = $fieldName;
-                if (isset($fileReferenceField)) {
-                    $payload['fileReferenceField'] = $fileReferenceField;
-                } else {
-                    $payload['fileReferenceField'] = null;
-                }
-            }
-        }
-        return $payload;
-    }
-
-    /**
-     * Get file object
-     *
-     * @param array $row
-     * @param string $fieldName
-     * @return \TYPO3\CMS\Core\Resource\File|null
-     */
-    private function getFile(array $row, $fieldName)
-    {
-        $file = null;
-        $fileUid = !empty($row[$fieldName]) ? $row[$fieldName] : null;
-        if (is_array($fileUid) && isset($fileUid[0]['uid'])) {
-            $fileUid = $fileUid[0]['uid'];
-        }
-        if (MathUtility::canBeInterpretedAsInteger($fileUid)) {
-            try {
-                $file = ResourceFactory::getInstance()->getFileObject((int)$fileUid);
-            } catch (FileDoesNotExistException $e) {
-            } catch (\InvalidArgumentException $e) {
-            }
-        }
-        return $file;
-    }
-}
diff --git a/typo3/sysext/install/Classes/Updates/RowUpdater/L10nModeUpdater.php b/typo3/sysext/install/Classes/Updates/RowUpdater/L10nModeUpdater.php
deleted file mode 100644 (file)
index e4fa2e7..0000000
+++ /dev/null
@@ -1,310 +0,0 @@
-<?php
-declare(strict_types = 1);
-namespace TYPO3\CMS\Install\Updates\RowUpdater;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
-use TYPO3\CMS\Core\Database\ConnectionPool;
-use TYPO3\CMS\Core\DataHandling\DataHandler;
-use TYPO3\CMS\Core\DataHandling\Localization\State;
-use TYPO3\CMS\Core\Localization\LanguageService;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Core\Versioning\VersionState;
-
-/**
- * Migrate values for database records having columns
- * using "l10n_mode" set to "mergeIfNotBlank" or "exclude".
- * @internal This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.
- */
-class L10nModeUpdater implements RowUpdaterInterface
-{
-    /**
-     * List of tables with information about to migrate fields.
-     * Created during hasPotentialUpdateForTable(), used in updateTableRow()
-     *
-     * @var array
-     */
-    protected $payload = [];
-
-    /**
-     * Get title
-     *
-     * @return string
-     */
-    public function getTitle(): string
-    {
-        return 'Migrate values in database records having "l10n_mode"'
-            . ' either set to "exclude" or "mergeIfNotBlank"';
-    }
-
-    /**
-     * Return true if a table needs modifications.
-     *
-     * @param string $tableName Table name to check
-     * @return bool True if this table has fields to migrate
-     */
-    public function hasPotentialUpdateForTable(string $tableName): bool
-    {
-        $this->payload[$tableName] = $this->getL10nModePayloadForTable($tableName);
-        return !empty($this->payload[$tableName]['localizations']);
-    }
-
-    /**
-     * Update single row if needed
-     *
-     * @param string $tableName
-     * @param array $inputRow Given row data
-     * @return array Modified row data
-     */
-    public function updateTableRow(string $tableName, array $inputRow): array
-    {
-        $currentId = (int)$inputRow['uid'];
-
-        if (empty($this->payload[$tableName]['localizations'][$currentId])) {
-            return $inputRow;
-        }
-
-        // disable DataHandler hooks for processing this update
-        if (!empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php'])) {
-            $dataHandlerHooks = $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php'];
-            unset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']);
-        }
-
-        if (empty($GLOBALS['LANG'])) {
-            $GLOBALS['LANG'] = GeneralUtility::makeInstance(LanguageService::class);
-        }
-        if (!empty($GLOBALS['BE_USER'])) {
-            $adminUser = $GLOBALS['BE_USER'];
-        }
-        // the admin user is required to defined workspace state when working with DataHandler
-        $fakeAdminUser = GeneralUtility::makeInstance(BackendUserAuthentication::class);
-        $fakeAdminUser->user = ['uid' => 0, 'username' => '_migration_', 'admin' => 1];
-        $fakeAdminUser->workspace = (int)($inputRow['t3ver_wsid'] ?? 0);
-        $GLOBALS['BE_USER'] = $fakeAdminUser;
-
-        $tablePayload = $this->payload[$tableName];
-
-        $liveId = $currentId;
-        if (!empty($inputRow['t3ver_wsid'])
-            && !empty($inputRow['t3ver_oid'])
-            && !VersionState::cast($inputRow['t3ver_state'])
-                ->equals(VersionState::NEW_PLACEHOLDER_VERSION)) {
-            $liveId = (int)$inputRow['t3ver_oid'];
-        }
-
-        $dataMap = [];
-
-        // define localization states and thus trigger updates later
-        if (State::isApplicable($tableName)) {
-            $stateUpdates = [];
-            foreach ($tablePayload['fieldModes'] as $fieldName => $fieldMode) {
-                if ($fieldMode !== 'mergeIfNotBlank') {
-                    continue;
-                }
-                if (!empty($inputRow[$fieldName])) {
-                    $stateUpdates[$fieldName] = State::STATE_CUSTOM;
-                } else {
-                    $stateUpdates[$fieldName] = State::STATE_PARENT;
-                }
-            }
-
-            // fetch the language state upfront, so that calling DataMapProcessor below
-            // will handle mergeIfNotBlank fields properly
-            $languageState = State::create($tableName);
-            $languageState->update($stateUpdates);
-            $dataMap = [
-                $tableName => [
-                    $liveId => [
-                        'l10n_state' => $languageState->toArray()
-                    ]
-                ]
-            ];
-        }
-
-        // simulate modifying a parent record to trigger dependent updates
-        if (in_array('exclude', $tablePayload['fieldModes'], true)) {
-            $record = $this->getRow($tableName, $liveId);
-            foreach ($tablePayload['fieldModes'] as $fieldName => $fieldMode) {
-                if ($fieldMode !== 'exclude') {
-                    continue;
-                }
-                $dataMap[$tableName][$liveId][$fieldName] = $record[$fieldName];
-            }
-        }
-
-        // in case $dataMap is empty, nothing has to be updated
-        if (!empty($dataMap)) {
-            // let DataHandler process all updates, $inputRow won't change
-            $dataHandler = GeneralUtility::makeInstance(DataHandler::class);
-            $dataHandler->enableLogging = false;
-            $dataHandler->start($dataMap, [], $fakeAdminUser);
-            $dataHandler->process_datamap();
-        }
-
-        if (!empty($dataHandlerHooks)) {
-            $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php'] = $dataHandlerHooks;
-        }
-        if (!empty($adminUser)) {
-            $GLOBALS['BE_USER'] = $adminUser;
-        }
-
-        // the unchanged(!) state as submitted
-        return $inputRow;
-    }
-
-    /**
-     * Retrieves field names grouped per table name having "l10n_mode" set
-     * to a relevant value that shall be migrated in database records.
-     *
-     * Resulting array is structured like this:
-     * + fields: [field a, field b, ...]
-     * + sources
-     *   + source uid: [localization uid, localization uid, ...]
-     *
-     * @param string $tableName Table name
-     * @return array Payload information for this table
-     * @throws \RuntimeException
-     */
-    protected function getL10nModePayloadForTable(string $tableName): array
-    {
-        if (!isset($GLOBALS['TCA'][$tableName]) || !\is_array($GLOBALS['TCA'][$tableName])) {
-            throw new \RuntimeException(
-                'Globals TCA of given table name must exist',
-                1484176136
-            );
-        }
-
-        $tableDefinition = $GLOBALS['TCA'][$tableName];
-        $languageFieldName = ($tableDefinition['ctrl']['languageField'] ?? null);
-        $parentFieldName = ($tableDefinition['ctrl']['transOrigPointerField'] ?? null);
-
-        if (
-            empty($tableDefinition['columns'])
-            || !is_array($tableDefinition['columns'])
-            || empty($languageFieldName)
-            || empty($parentFieldName)
-        ) {
-            return [];
-        }
-
-        $fieldModes = [];
-        foreach ($tableDefinition['columns'] as $fieldName => $fieldConfiguration) {
-            $l10nMode = ($fieldConfiguration['l10n_mode'] ?? null);
-            $allowLanguageSynchronization = ($fieldConfiguration['config']['behaviour']['allowLanguageSynchronization'] ?? null);
-
-            if ($l10nMode === 'exclude') {
-                $fieldModes[$fieldName] = $l10nMode;
-            } elseif ($allowLanguageSynchronization) {
-                $fieldModes[$fieldName] = 'mergeIfNotBlank';
-            }
-        }
-
-        if (empty($fieldModes)) {
-            return [];
-        }
-
-        $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
-        $queryBuilder = $connectionPool->getQueryBuilderForTable($tableName);
-        $queryBuilder->getRestrictions()->removeAll();
-        $queryBuilder->from($tableName);
-
-        $parentFieldName = $tableDefinition['ctrl']['transOrigPointerField'];
-        $selectFieldNames = ['uid', $parentFieldName];
-
-        $predicates = [
-            $queryBuilder->expr()->gt(
-                $tableDefinition['ctrl']['languageField'],
-                $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)
-            ),
-            $queryBuilder->expr()->gt(
-                $parentFieldName,
-                $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)
-            )
-        ];
-
-        if (!empty($tableDefinition['ctrl']['versioningWS'])) {
-            $selectFieldNames = array_merge(
-                $selectFieldNames,
-                ['t3ver_wsid', 't3ver_oid', 't3ver_state']
-            );
-            $predicates[] = $queryBuilder->expr()->orX(
-                $queryBuilder->expr()->eq(
-                    't3ver_state',
-                    $queryBuilder->createNamedParameter(
-                        VersionState::NEW_PLACEHOLDER_VERSION,
-                        \PDO::PARAM_INT
-                    )
-                ),
-                $queryBuilder->expr()->eq(
-                    't3ver_state',
-                    $queryBuilder->createNamedParameter(
-                        VersionState::DEFAULT_STATE,
-                        \PDO::PARAM_INT
-                    )
-                ),
-                $queryBuilder->expr()->eq(
-                    't3ver_state',
-                    $queryBuilder->createNamedParameter(
-                        VersionState::MOVE_POINTER,
-                        \PDO::PARAM_INT
-                    )
-                )
-            );
-        }
-
-        $statement = $queryBuilder
-            ->select(...$selectFieldNames)
-            ->andWhere(...$predicates)
-            ->execute();
-
-        $payload = [];
-
-        foreach ($statement as $row) {
-            $translationId = $row['uid'];
-            $parentId = (int)$row[$parentFieldName];
-            $payload['localizations'][$translationId] = $parentId;
-        }
-        if (!empty($payload['localizations'])) {
-            $payload['fieldModes'] = $fieldModes;
-        }
-
-        return $payload;
-    }
-
-    /**
-     * @param string $tableName
-     * @param int $id
-     * @return array
-     */
-    protected function getRow(string $tableName, int $id)
-    {
-        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
-            ->getQueryBuilderForTable($tableName);
-        $queryBuilder->getRestrictions()->removeAll();
-
-        $statement = $queryBuilder
-            ->select('*')
-            ->from($tableName)
-            ->where(
-                $queryBuilder->expr()->eq(
-                    'uid',
-                    $queryBuilder->createNamedParameter($id, \PDO::PARAM_INT)
-                )
-            )
-            ->execute();
-
-        return $statement->fetch();
-    }
-}
diff --git a/typo3/sysext/install/Classes/Updates/RowUpdater/RteLinkSyntaxUpdater.php b/typo3/sysext/install/Classes/Updates/RowUpdater/RteLinkSyntaxUpdater.php
deleted file mode 100644 (file)
index 483ed88..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-<?php
-declare(strict_types = 1);
-namespace TYPO3\CMS\Install\Updates\RowUpdater;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use Psr\Log\LoggerInterface;
-use TYPO3\CMS\Core\LinkHandling\Exception\UnknownLinkHandlerException;
-use TYPO3\CMS\Core\LinkHandling\Exception\UnknownUrnException;
-use TYPO3\CMS\Core\LinkHandling\LinkService;
-use TYPO3\CMS\Core\Log\LogManager;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Frontend\Service\TypoLinkCodecService;
-
-/**
- * Move '<link ...' syntax to '<a href' in rte fields
- * @internal This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.
- */
-class RteLinkSyntaxUpdater implements RowUpdaterInterface
-{
-    /**
-     * Table list with field list that may have links them
-     *
-     * @var array
-     */
-    protected $tableFieldListToConsider = [];
-
-    /**
-     * @var array Table names that should be ignored.
-     */
-    protected $blackListedTables = [
-        'sys_log',
-        'sys_history',
-        'sys_template',
-    ];
-
-    /**
-     * Regular expressions to match the <link ...>content</link> inside
-     * @var array
-     */
-    protected $regularExpressions = [
-        'default' => '#
-            (?\'tag\'<link\\s++(?\'typolink\'[^>]+)>)
-            (?\'content\'(?:[^<]++|<(?!/link>))*+)
-            </link>
-            #xumsi',
-        'flex' => '#
-            (?\'tag\'&lt;link\\s++(?\'typolink\'(?:[^&]++|&(?!gt;))++)&gt;)
-            (?\'content\'(?:[^&]++|&(?!lt;/link&gt;))*+)
-            &lt;/link&gt;
-            #xumsi'
-    ];
-
-    /**
-     * @var LoggerInterface
-     */
-    protected $logger;
-
-    /**
-     * Get title
-     *
-     * @return string Title
-     */
-    public function getTitle(): string
-    {
-        return 'Scan for old "<link>" syntax in richtext and text fields and update to "<a href>"';
-    }
-
-    /**
-     * Return true if a table may have RTE fields
-     *
-     * @param string $tableName Table name to check
-     * @return bool True if this table potentially has RTE fields
-     */
-    public function hasPotentialUpdateForTable(string $tableName): bool
-    {
-        if (!is_array($GLOBALS['TCA'][$tableName])) {
-            throw new \RuntimeException(
-                'Globals TCA of ' . $tableName . ' must be an array',
-                1484173035
-            );
-        }
-        $result = false;
-        if (in_array($tableName, $this->blackListedTables, true)) {
-            return $result;
-        }
-        $tcaOfTable = $GLOBALS['TCA'][$tableName];
-        if (!is_array($tcaOfTable['columns'])) {
-            return $result;
-        }
-        foreach ($tcaOfTable['columns'] as $fieldName => $fieldConfiguration) {
-            if (isset($fieldConfiguration['config']['type'])
-                && in_array($fieldConfiguration['config']['type'], ['input', 'text', 'flex'], true)
-            ) {
-                $result = true;
-                if (!is_array($this->tableFieldListToConsider[$tableName])) {
-                    $this->tableFieldListToConsider[$tableName] = [];
-                }
-                $this->tableFieldListToConsider[$tableName][] = $fieldName;
-            }
-        }
-        return $result;
-    }
-
-    /**
-     * Update "<link" tags in RTE fields
-     *
-     * @param string $tableName Table name
-     * @param array $row Given row data
-     * @return array Modified row data
-     */
-    public function updateTableRow(string $tableName, array $row): array
-    {
-        if (!is_array($this->tableFieldListToConsider)) {
-            throw new \RuntimeException(
-                'Parent should not call me with a table name I do not consider relevant for update',
-                1484173650
-            );
-        }
-        $this->logger = GeneralUtility::makeInstance(LogManager::class)->getLogger(__CLASS__);
-        $fieldsToScan = $this->tableFieldListToConsider[$tableName];
-        foreach ($fieldsToScan as $fieldName) {
-            $row[$fieldName] = $this->transformLinkTagsIfFound(
-                $tableName,
-                $fieldName,
-                $row,
-                $GLOBALS['TCA'][$tableName]['columns'][$fieldName]['config']['type'] === 'flex'
-            );
-        }
-        return $row;
-    }
-
-    /**
-     * Finds all <link> tags and calls the typolink codec service and the link service (twice) to get a string
-     * representation of the href part, and then builds an anchor tag.
-     *
-     * @param string $tableName
-     * @param string $fieldName
-     * @param array $row
-     * @param bool $isFlexformField If true the content is htmlspecialchar()'d and must be treated as such
-     * @return mixed the modified content
-     */
-    protected function transformLinkTagsIfFound(string $tableName, string $fieldName, array $row, bool $isFlexformField)
-    {
-        $content = $row[$fieldName];
-        if (is_string($content)
-            && !empty($content)
-            && (stripos($content, '<link') !== false || stripos($content, '&lt;link') !== false)
-        ) {
-            $result = preg_replace_callback(
-                $this->regularExpressions[$isFlexformField ? 'flex' : 'default'],
-                function ($matches) use ($isFlexformField) {
-                    $typoLink = $isFlexformField ? htmlspecialchars_decode($matches['typolink']) : $matches['typolink'];
-                    $typoLinkParts = GeneralUtility::makeInstance(TypoLinkCodecService::class)->decode($typoLink);
-                    $anchorTagAttributes = [
-                        'target' => $typoLinkParts['target'],
-                        'class' => $typoLinkParts['class'],
-                        'title' => $typoLinkParts['title'],
-                    ];
-
-                    $link = $typoLinkParts['url'];
-                    if (!empty($typoLinkParts['additionalParams'])) {
-                        $link .= (strpos($link, '?') === false ? '?' : '&') . ltrim($typoLinkParts['additionalParams'], '&');
-                    }
-
-                    try {
-                        $linkService = GeneralUtility::makeInstance(LinkService::class);
-                        // Ensure the old syntax is converted to the new t3:// syntax, if necessary
-                        $linkParts = $linkService->resolve($link);
-                        $anchorTagAttributes['href'] = $linkService->asString($linkParts);
-                        $newLink = '<a ' . GeneralUtility::implodeAttributes($anchorTagAttributes, true) . '>' .
-                            ($isFlexformField ? htmlspecialchars_decode($matches['content']) : $matches['content']) .
-                            '</a>';
-                        if ($isFlexformField) {
-                            $newLink = htmlspecialchars($newLink);
-                        }
-                    } catch (UnknownLinkHandlerException $e) {
-                        $newLink = $matches[0];
-                    } catch (UnknownUrnException $e) {
-                        $newLink = $matches[0];
-                    }
-
-                    return $newLink;
-                },
-                $content
-            );
-            if ($result !== null) {
-                $content = $result;
-            } else {
-                $this->logger->error('Converting links failed due to PCRE error', [
-                    'table' => $tableName,
-                    'field' => $fieldName,
-                    'uid' => $row['uid'] ?? null,
-                    'errorCode' => preg_last_error()
-                ]);
-            }
-        }
-        return $content;
-    }
-}
diff --git a/typo3/sysext/install/Classes/Updates/RteHtmlAreaExtractionUpdate.php b/typo3/sysext/install/Classes/Updates/RteHtmlAreaExtractionUpdate.php
deleted file mode 100644 (file)
index a1df0c4..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-<?php
-namespace TYPO3\CMS\Install\Updates;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
-
-/**
- * Installs and downloads EXT:rtehtmlarea if needed
- * @internal This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.
- */
-class RteHtmlAreaExtractionUpdate extends AbstractDownloadExtensionUpdate
-{
-    /**
-     * @var \TYPO3\CMS\Install\Updates\Confirmation
-     */
-    protected $confirmation;
-
-    public function __construct()
-    {
-        $this->extension = new ExtensionModel(
-            'rtehtmlarea',
-            'RTE HTMLArea for TYPO3',
-            '8.7.0',
-            'friendsoftypo3/rtehtmlarea',
-            'The extension provides the well-known RTE used in previous TYPO3 versions, if handling of images or custom legacy configurations are necessary.'
-        );
-
-        $this->confirmation = new Confirmation(
-            'Are you sure?',
-            'You should install EXT:rtehtmlarea only if you really need it. ' . $this->extension->getDescription(),
-            false
-        );
-    }
-
-    /**
-     * Return a confirmation message instance
-     *
-     * @return \TYPO3\CMS\Install\Updates\Confirmation
-     */
-    public function getConfirmation(): Confirmation
-    {
-        return $this->confirmation;
-    }
-
-    /**
-     * Return the identifier for this wizard
-     * This should be the same string as used in the ext_localconf class registration
-     *
-     * @return string
-     */
-    public function getIdentifier(): string
-    {
-        return 'rtehtmlareaExtension';
-    }
-
-    /**
-     * Return the speaking name of this wizard
-     *
-     * @return string
-     */
-    public function getTitle(): string
-    {
-        return 'Install extension "rtehtmlarea" from TER';
-    }
-
-    /**
-     * Return the description for this wizard
-     *
-     * @return string
-     */
-    public function getDescription(): string
-    {
-        return 'The extension "rtehtmlarea" (RTE based on HtmlArea) was extracted into'
-               . ' the TYPO3 Extension Repository. This update downloads the TYPO3 Extension from the TER.'
-               . ' Use this if you have special configurations or image handling within Rich Text fields and uninstall the shipped EXT:rte_ckeditor.';
-    }
-
-    /**
-     * Is an update necessary?
-     * Is used to determine whether a wizard needs to be run.
-     *
-     * @return bool
-     */
-    public function updateNecessary(): bool
-    {
-        return !ExtensionManagementUtility::isLoaded('rtehtmlarea');
-    }
-
-    /**
-     * Returns an array of class names of Prerequisite classes
-     * This way a wizard can define dependencies like "database up-to-date" or
-     * "reference index updated"
-     *
-     * @return string[]
-     */
-    public function getPrerequisites(): array
-    {
-        return [];
-    }
-}
diff --git a/typo3/sysext/install/Classes/Updates/SectionFrameToFrameClassUpdate.php b/typo3/sysext/install/Classes/Updates/SectionFrameToFrameClassUpdate.php
deleted file mode 100644 (file)
index 4d28678..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-<?php
-namespace TYPO3\CMS\Install\Updates;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Database\ConnectionPool;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-
-/**
- * Migrate the field 'section_frame' for all content elements to 'frame_class'
- * @internal This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.
- */
-class SectionFrameToFrameClassUpdate implements UpgradeWizardInterface
-{
-    /**
-     * @return string Unique identifier of this updater
-     */
-    public function getIdentifier(): string
-    {
-        return 'sectionFrameToFrameClassUpdate';
-    }
-
-    /**
-     * @return string Title of this updater
-     */
-    public function getTitle(): string
-    {
-        return 'Migrate the field "section_frame" for all content elements to "frame_class"';
-    }
-
-    /**
-     * @return string Longer description of this updater
-     */
-    public function getDescription(): string
-    {
-        return 'Section frames were used to control the wrapping of each content element in the frontend '
-            . 'output, stored as integers in the database. To get rid of a nessesary mapping of those values we '
-            . 'are now storing strings you can easily adjust that will simply passed to the rendering.';
-    }
-
-    /**
-     * Checks if an update is needed
-     *
-     * @return bool Whether an update is needed (TRUE) or not (FALSE)
-     */
-    public function updateNecessary(): bool
-    {
-        $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('tt_content');
-        $tableColumns = $connection->getSchemaManager()->listTableColumns('tt_content');
-        // Only proceed if section_frame field still exists
-        if (!isset($tableColumns['section_frame'])) {
-            return false;
-        }
-        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tt_content');
-        $queryBuilder->getRestrictions()->removeAll();
-        $elementCount = $queryBuilder->count('uid')
-            ->from('tt_content')
-            ->where(
-                $queryBuilder->expr()->gt('section_frame', 0)
-            )
-            ->execute()
-            ->fetchColumn(0);
-        return (bool)$elementCount;
-    }
-
-    /**
-     * @return string[] All new fields and tables must exist
-     */
-    public function getPrerequisites(): array
-    {
-        return [
-            DatabaseUpdatedPrerequisite::class
-        ];
-    }
-
-    /**
-     * Performs the database update
-     *
-     * @return bool
-     */
-    public function executeUpdate(): bool
-    {
-        $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('tt_content');
-        $queryBuilder = $connection->createQueryBuilder();
-        $queryBuilder->getRestrictions()->removeAll();
-        $statement = $queryBuilder->select('uid', 'section_frame')
-            ->from('tt_content')
-            ->where(
-                $queryBuilder->expr()->gt('section_frame', 0)
-            )
-            ->execute();
-        while ($record = $statement->fetch()) {
-            $queryBuilder = $connection->createQueryBuilder();
-            $queryBuilder->update('tt_content')
-                ->where(
-                    $queryBuilder->expr()->eq(
-                        'uid',
-                        $queryBuilder->createNamedParameter($record['uid'], \PDO::PARAM_INT)
-                    )
-                )
-                ->set('section_frame', 0, false)
-                ->set('frame_class', $this->mapSectionFrame($record['section_frame']));
-            $queryBuilder->execute();
-        }
-        return true;
-    }
-
-    /**
-     * Map the old to the new values
-     *
-     * @param int $sectionFrame The content of the FlexForm
-     * @return string The equivalent value frame_class
-     */
-    protected function mapSectionFrame($sectionFrame)
-    {
-        $mapping = [
-            0 => 'default',
-            5 => 'ruler-before',
-            6 => 'ruler-after',
-            10 => 'indent',
-            11 => 'indent-left',
-            12 => 'indent-right',
-            66 => 'none'
-        ];
-        if (array_key_exists($sectionFrame, $mapping)) {
-            return $mapping[$sectionFrame];
-        }
-        return 'custom-' . (int)$sectionFrame;
-    }
-}
diff --git a/typo3/sysext/install/Classes/Updates/SplitMenusUpdate.php b/typo3/sysext/install/Classes/Updates/SplitMenusUpdate.php
deleted file mode 100644 (file)
index 9aa7ae2..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-<?php
-namespace TYPO3\CMS\Install\Updates;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Database\ConnectionPool;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-
-/**
- * Split menu types into dedicated content elements
- * @internal This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.
- */
-class SplitMenusUpdate implements UpgradeWizardInterface
-{
-    /**
-     * @return string Unique identifier of this updater
-     */
-    public function getIdentifier(): string
-    {
-        return 'splitMenusUpdate';
-    }
-
-    /**
-     * @return string Title of this updater
-     */
-    public function getTitle(): string
-    {
-        return 'Split menu types into dedicated content elements';
-    }
-
-    /**
-     * @return string Longer description of this updater
-     */
-    public function getDescription(): string
-    {
-        return 'Menus have been split into dedicated content elements to provide '
-            . 'a better maintainability and more easy to adjustable template with single '
-            . 'responsibility for the rendering.';
-    }
-
-    /**
-     * Checks if an update is needed
-     *
-     * @return bool Whether an update is needed (TRUE) or not (FALSE)
-     */
-    public function updateNecessary(): bool
-    {
-        $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('tt_content');
-        $tableColumns = $connection->getSchemaManager()->listTableColumns('tt_content');
-        // Only proceed if menu_type field still exists
-        if (!isset($tableColumns['menu_type'])) {
-            return false;
-        }
-        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tt_content');
-        $queryBuilder->getRestrictions()->removeAll();
-        $elementCount = $queryBuilder->count('uid')
-            ->from('tt_content')
-            ->where(
-                $queryBuilder->expr()->eq('CType', $queryBuilder->createNamedParameter('menu', \PDO::PARAM_STR))
-            )
-            ->execute()->fetchColumn(0);
-        return (bool)$elementCount;
-    }
-
-    /**
-     * @return string[] All new fields and tables must exist
-     */
-    public function getPrerequisites(): array
-    {
-        return [
-            DatabaseUpdatedPrerequisite::class
-        ];
-    }
-
-    /**
-     * Performs the database update
-     *
-     * @return bool
-     */
-    public function executeUpdate(): bool
-    {
-        $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('tt_content');
-        $queryBuilder = $connection->createQueryBuilder();
-        $queryBuilder->getRestrictions()->removeAll();
-        $statement = $queryBuilder->select('uid', 'header', 'menu_type')
-            ->from('tt_content')
-            ->where(
-                $queryBuilder->expr()->eq(
-                    'CType',
-                    $queryBuilder->createNamedParameter('menu', \PDO::PARAM_STR)
-                )
-            )
-            ->execute();
-        while ($record = $statement->fetch()) {
-            $queryBuilder = $connection->createQueryBuilder();
-            $queryBuilder->update('tt_content')
-                ->where(
-                    $queryBuilder->expr()->eq(
-                        'uid',
-                        $queryBuilder->createNamedParameter($record['uid'], \PDO::PARAM_INT)
-                    )
-                )
-                ->set('CType', $this->mapMenuTypes($record['menu_type']));
-            $queryBuilder->execute();
-        }
-        return true;
-    }
-
-    /**
-     * Map the old to the new values
-     *
-     * @param string $menuType The content of the FlexForm
-     * @return string The equivalent CType
-     */
-    protected function mapMenuTypes($menuType)
-    {
-        $mapping = [
-            0 => 'menu_pages',
-            1 => 'menu_subpages',
-            2 => 'menu_sitemap',
-            3 => 'menu_section',
-            4 => 'menu_abstract',
-            5 => 'menu_recently_updated',
-            6 => 'menu_related_pages',
-            7 => 'menu_section_pages',
-            8 => 'menu_sitemap_pages',
-            'categorized_pages' => 'menu_categorized_pages',
-            'categorized_content' => 'menu_categorized_content'
-        ];
-        if (array_key_exists($menuType, $mapping)) {
-            return $mapping[$menuType];
-        }
-        return 'menu_' . $menuType;
-    }
-}
diff --git a/typo3/sysext/install/Classes/Updates/StartModuleUpdate.php b/typo3/sysext/install/Classes/Updates/StartModuleUpdate.php
deleted file mode 100644 (file)
index bdd9911..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-<?php
-namespace TYPO3\CMS\Install\Updates;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Database\ConnectionPool;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-
-/**
- * Update backend user setting startModule if set to "help_aboutmodules"
- * @internal This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.
- */
-class StartModuleUpdate implements UpgradeWizardInterface
-{
-    /**
-     * @return string Unique identifier of this updater
-     */
-    public function getIdentifier(): string
-    {
-        return 'startModuleUpdate';
-    }
-
-    /**
-     * @return string Title of this updater
-     */
-    public function getTitle(): string
-    {
-        return 'Update backend user setting "startModule"';
-    }
-
-    /**
-     * @return string Longer description of this updater
-     */
-    public function getDescription(): string
-    {
-        return 'The backend user setting startModule is changed for the extensions about/aboutmodules.'
-            . ' Update all backend users that use ext:aboutmodules as startModule.';
-    }
-
-    /**
-     * Checks if an update is needed
-     *
-     * @return bool Whether an update is needed (TRUE) or not (FALSE)
-     */
-    public function updateNecessary(): bool
-    {
-        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('be_users');
-        $queryBuilder->getRestrictions()->removeAll();
-        $statement = $queryBuilder->select('uid', 'uc')->from('be_users')->execute();
-        $needsExecution = false;
-        while ($backendUser = $statement->fetch()) {
-            if ($backendUser['uc'] !== null) {
-                $userConfig = unserialize($backendUser['uc'], ['allowed_classes' => false]);
-                if ($userConfig['startModule'] === 'help_aboutmodules'
-                    || $userConfig['startModule'] === 'help_AboutmodulesAboutmodules'
-                    || $userConfig['startModule'] === 'help_AboutAboutmodules'
-                ) {
-                    $needsExecution = true;
-                    break;
-                }
-            }
-        }
-        return $needsExecution;
-    }
-
-    /**
-     * @return string[] All new fields and tables must exist
-     */
-    public function getPrerequisites(): array
-    {
-        return [
-            DatabaseUpdatedPrerequisite::class
-        ];
-    }
-
-    /**
-     * Performs the database update if backend user's startmodule is
-     * "help_aboutmodules" or "help_AboutmodulesAboutmodules"
-     *
-     * @return bool
-     */
-    public function executeUpdate(): bool
-    {
-        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('be_users');
-        $queryBuilder->getRestrictions()->removeAll();
-        $statement = $queryBuilder->select('uid', 'uc')->from('be_users')->execute();
-        while ($backendUser = $statement->fetch()) {
-            if ($backendUser['uc'] !== null) {
-                $userConfig = unserialize($backendUser['uc'], ['allowed_classes' => false]);
-                if ($userConfig['startModule'] === 'help_aboutmodules'
-                    || $userConfig['startModule'] === 'help_AboutmodulesAboutmodules'
-                    || $userConfig['startModule'] === 'help_AboutAboutmodules'
-                ) {
-                    $userConfig['startModule'] = 'help_AboutAbout';
-                    $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('be_users');
-                    $queryBuilder->getRestrictions()->removeAll();
-                    $queryBuilder->update('be_users')
-                        ->where(
-                            $queryBuilder->expr()->eq(
-                                'uid',
-                                $queryBuilder->createNamedParameter($backendUser['uid'], \PDO::PARAM_INT)
-                            )
-                        )
-                        // Manual quoting and false as third parameter to have the final
-                        // value in $databaseQueries and not a statement placeholder
-                        ->set('uc', serialize($userConfig))
-                        ->execute();
-                }
-            }
-        }
-        return true;
-    }
-}
diff --git a/typo3/sysext/install/Classes/Updates/UploadContentElementUpdate.php b/typo3/sysext/install/Classes/Updates/UploadContentElementUpdate.php
deleted file mode 100644 (file)
index 200a5c5..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-<?php
-namespace TYPO3\CMS\Install\Updates;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Database\ConnectionPool;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-
-/**
- * Migrate upload content element rendering from layout to uploads_type
- * @internal This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.
- */
-class UploadContentElementUpdate implements UpgradeWizardInterface
-{
-    /**
-     * @return string Unique identifier of this updater
-     */
-    public function getIdentifier(): string
-    {
-        return 'uploadContentElementUpdate';
-    }
-
-    /**
-     * @return string Title of this updater
-     */
-    public function getTitle(): string
-    {
-        return 'Migrate upload content element rendering from layout to uploads_type';
-    }
-
-    /**
-     * @return string Longer description of this updater
-     */
-    public function getDescription(): string
-    {
-        return 'Rendering type field has been streamlined with fluid_styled_content.';
-    }
-
-    /**
-     * Checks if an update is needed
-     *
-     * @return bool Whether an update is needed (TRUE) or not (FALSE)
-     */
-    public function updateNecessary(): bool
-    {
-        $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('tt_content');
-        $queryBuilder->getRestrictions()->removeAll();
-        $elementCount = $queryBuilder->count('uid')
-            ->from('tt_content')
-            ->where(
-                $queryBuilder->expr()->eq('CType', $queryBuilder->createNamedParameter('uploads', \PDO::PARAM_STR)),
-                $queryBuilder->expr()->in('layout', [1, 2])
-            )
-            ->execute()
-            ->fetchColumn(0);
-        return (bool)$elementCount;
-    }
-
-    /**
-     * @return string[] All new fields and tables must exist
-     */
-    public function getPrerequisites(): array
-    {
-        return [
-            DatabaseUpdatedPrerequisite::class
-        ];
-    }
-
-    /**
-     * Performs the database update
-     *
-     * @return bool
-     */
-    public function executeUpdate(): bool
-    {
-        $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable('tt_content');
-        $queryBuilder = $connection->createQueryBuilder();
-        $queryBuilder->getRestrictions()->removeAll();
-        $statement = $queryBuilder->select('uid', 'layout')
-            ->from('tt_content')
-            ->where(
-                $queryBuilder->expr()->eq('CType', $queryBuilder->createNamedParameter('uploads', \PDO::PARAM_STR)),
-                $queryBuilder->expr()->in('layout', [1, 2])
-            )
-            ->execute();
-        while ($record = $statement->fetch()) {
-            $queryBuilder = $connection->createQueryBuilder();
-            $queryBuilder->update('tt_content')
-                ->where(
-                    $queryBuilder->expr()->eq(
-                        'uid',
-                        $queryBuilder->createNamedParameter($record['uid'], \PDO::PARAM_INT)
-                    )
-                )
-                ->set('layout', 0, false)
-                ->set('uploads_type', $record['layout'])
-                ->execute();
-        }
-        return true;
-    }
-}
diff --git a/typo3/sysext/install/Classes/Updates/WizardDoneToRegistry.php b/typo3/sysext/install/Classes/Updates/WizardDoneToRegistry.php
deleted file mode 100644 (file)
index 4e22921..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-<?php
-namespace TYPO3\CMS\Install\Updates;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Configuration\ConfigurationManager;
-use TYPO3\CMS\Core\Registry;
-use TYPO3\CMS\Core\Utility\Exception\MissingArrayPathException;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-
-/**
- * Move "wizard done" flags to system registry
- * @internal This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.
- */
-class WizardDoneToRegistry implements UpgradeWizardInterface
-{
-    /**
-     * @return string Unique identifier of this updater
-     */
-    public function getIdentifier(): string
-    {
-        return 'wizardDoneToRegistry';
-    }
-
-    /**
-     * @return string Title of this updater
-     */
-    public function getTitle(): string
-    {
-        return 'Move "wizard done" flags from LocalConfiguration.php to system registry';
-    }
-
-    /**
-     * @return string Longer description of this updater
-     */
-    public function getDescription(): string
-    {
-        return 'Moves all "wizard done" flags from LocalConfiguration.php to system registry.';
-    }
-
-    /**
-     * Checks if an update is needed
-     *
-     * @return bool Whether an update is needed (TRUE) or not (FALSE)
-     */
-    public function updateNecessary(): bool
-    {
-        $result = false;
-        try {
-            $wizardsDone = GeneralUtility::makeInstance(ConfigurationManager::class)
-                ->getLocalConfigurationValueByPath('INSTALL/wizardDone');
-            if (!empty($wizardsDone)) {
-                $result = true;
-            }
-        } catch (MissingArrayPathException $e) {
-            // Result stays false with broken path
-        }
-        return $result;
-    }
-
-    /**
-     * @return string[] All new fields and tables must exist
-     */
-    public function getPrerequisites(): array
-    {
-        return [
-            DatabaseUpdatedPrerequisite::class
-        ];
-    }
-
-    /**
-     * Performs the accordant updates.
-     *
-     * @return bool Whether everything went smoothly or not
-     */
-    public function executeUpdate(): bool
-    {
-        $configurationManager = GeneralUtility::makeInstance(ConfigurationManager::class);
-        $registry = GeneralUtility::makeInstance(Registry::class);
-        $wizardsDone = $configurationManager->getLocalConfigurationValueByPath('INSTALL/wizardDone');
-        $configurationKeysToRemove = [];
-        foreach ($wizardsDone as $wizardClassName => $value) {
-            $registry->set('installUpdate', $wizardClassName, $value);
-            $configurationKeysToRemove[] = 'INSTALL/wizardDone/' . $wizardClassName;
-        }
-        $configurationKeysToRemove[] = 'INSTALL/wizardDone';
-        $configurationManager->removeLocalConfigurationKeysByPath($configurationKeysToRemove);
-        return true;
-    }
-}
diff --git a/typo3/sysext/install/Tests/Functional/Updates/CommandLineBackendUserRemovalUpdateTest.php b/typo3/sysext/install/Tests/Functional/Updates/CommandLineBackendUserRemovalUpdateTest.php
deleted file mode 100644 (file)
index a090f91..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-declare(strict_types = 1);
-namespace TYPO3\CMS\Install\Tests\Functional\Updates;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use Symfony\Component\Console\Output\OutputInterface;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Install\Updates\CommandLineBackendUserRemovalUpdate;
-use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
-
-/**
- * Test case
- */
-class CommandLineBackendUserRemovalUpdateTest extends FunctionalTestCase
-{
-    /**
-     * @test
-     */
-    public function cliUsersAreMarkedAsDeleted()
-    {
-        $this->importCSVDataSet(GeneralUtility::getFileAbsFileName(
-            'typo3/sysext/install/Tests/Functional/Updates/DataSet/CommandLineBackendUserRemovalBefore.csv'
-        ));
-        $subject = new CommandLineBackendUserRemovalUpdate();
-        $outputProphecy = $this->prophesize(OutputInterface::class);
-        $subject->setOutput($outputProphecy->reveal());
-        $subject->executeUpdate();
-        $this->assertCSVDataSet(GeneralUtility::getFileAbsFileName(
-            'typo3/sysext/install/Tests/Functional/Updates/DataSet/CommandLineBackendUserRemovalAfter.csv'
-        ));
-    }
-}
diff --git a/typo3/sysext/install/Tests/Functional/Updates/DataSet/CommandLineBackendUserRemovalAfter.csv b/typo3/sysext/install/Tests/Functional/Updates/DataSet/CommandLineBackendUserRemovalAfter.csv
deleted file mode 100644 (file)
index e7ba0b1..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-"be_users",,,
-,"uid","username","deleted"
-,1,"_CLI_foo",1
-,15,"foo",0
-,2,"_cLi_bar",1
-,3,"_cli_BAZ",1
-,4,"_cli_",0
diff --git a/typo3/sysext/install/Tests/Functional/Updates/DataSet/CommandLineBackendUserRemovalBefore.csv b/typo3/sysext/install/Tests/Functional/Updates/DataSet/CommandLineBackendUserRemovalBefore.csv
deleted file mode 100644 (file)
index 94c0dfd..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-"be_users",,,
-,"uid","username","deleted"
-,1,"_CLI_foo",0
-,15,"foo",0
-,2,"_cLi_bar",0
-,3,"_cli_BAZ",0
-,4,"_cli_",0
diff --git a/typo3/sysext/install/Tests/Functional/Updates/RowUpdater/DataSet/LiveDefaultElements.csv b/typo3/sysext/install/Tests/Functional/Updates/RowUpdater/DataSet/LiveDefaultElements.csv
deleted file mode 100644 (file)
index af1d5fb..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-"sys_language",,,,,,,,,,,,,,,,,,
-,"uid","pid","hidden","title","flag",,,,,,,,,,,,,
-,1,0,0,"Dansk","dk",,,,,,,,,,,,,
-,2,0,0,"Deutsch","de",,,,,,,,,,,,,
-"tt_content",,,,,,,,,,,,,,,,,,
-,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","header","image","tx_irretutorial_1nff_hotels",,,
-,297,89,256,0,0,0,0,0,0,0,0,0,"Regular Element #1",0,2,,,
-,298,89,512,0,0,0,0,0,0,0,0,0,"Regular Element #2",0,0,,,
-,299,89,1024,0,1,297,0,0,0,0,0,0,,0,0,,,
-,300,89,2048,0,1,298,0,0,0,0,0,0,"Regular Element #2++",0,1,,,
-"tx_irretutorial_1nff_hotel",,,,,,,,,,,,,,,,,,
-,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","l18n_diffsource","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","title","parentid","parenttable","parentidentifier","offers"
-,2,89,1,0,0,0,,0,0,0,0,0,0,"Hotel #0",89,"pages",,0
-,3,89,1,0,0,0,,0,0,0,0,0,0,"Hotel #1",297,"tt_content",,2
-,4,89,2,0,0,0,,0,0,0,0,0,0,"Hotel #2",297,"tt_content",,1
-,5,89,1,0,1,0,,0,0,0,0,0,0,"Hotel #3",300,"tt_content",,0
-"tx_irretutorial_1nff_offer",,,,,,,,,,,,,,,,,,
-,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","l18n_diffsource","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","title","parentid","parenttable","parentidentifier","prices"
-,5,89,1,0,0,0,,0,0,0,0,0,0,"Offer #1.1",3,"tx_irretutorial_1nff_hotel",,3
-,6,89,2,0,0,0,,0,0,0,0,0,0,"Offer #1.2",3,"tx_irretutorial_1nff_hotel",,2
-,7,89,1,0,0,0,,0,0,0,0,0,0,"Offer #2.1",4,"tx_irretutorial_1nff_hotel",,1
-"tx_irretutorial_1nff_price",,,,,,,,,,,,,,,,,,
-,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","l18n_diffsource","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","title","parentid","parenttable","parentidentifier",
-,7,89,1,0,0,0,,0,0,0,0,0,0,"Price #1.1.1",5,"tx_irretutorial_1nff_offer",,
-,8,89,2,0,0,0,,0,0,0,0,0,0,"Price #1.1.2",5,"tx_irretutorial_1nff_offer",,
-,9,89,3,0,0,0,,0,0,0,0,0,0,"Price #1.1.3",5,"tx_irretutorial_1nff_offer",,
-,10,89,1,0,0,0,,0,0,0,0,0,0,"Price #1.2.1",6,"tx_irretutorial_1nff_offer",,
-,11,89,2,0,0,0,,0,0,0,0,0,0,"Price #1.2.2",6,"tx_irretutorial_1nff_offer",,
-,12,89,1,0,0,0,,0,0,0,0,0,0,"Price #2.1.1",7,"tx_irretutorial_1nff_offer",,
diff --git a/typo3/sysext/install/Tests/Functional/Updates/RowUpdater/DataSet/LiveDefaultPages.csv b/typo3/sysext/install/Tests/Functional/Updates/RowUpdater/DataSet/LiveDefaultPages.csv
deleted file mode 100644 (file)
index fd23e64..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-"pages",,,,,,,,,,,,
-,"uid","pid","sorting","deleted","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","title","tx_irretutorial_hotels"
-,1,0,256,0,0,0,0,0,0,0,"FunctionalTest",0
-,88,1,256,0,0,0,0,0,0,0,"DataHandlerTest",0
-,89,88,256,0,0,0,0,0,0,0,"Relations",1
-,90,88,512,0,0,0,0,0,0,0,"Target",0
diff --git a/typo3/sysext/install/Tests/Functional/Updates/RowUpdater/DataSet/recordsCanBeUpdated.csv b/typo3/sysext/install/Tests/Functional/Updates/RowUpdater/DataSet/recordsCanBeUpdated.csv
deleted file mode 100644 (file)
index 7797e5f..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-"sys_language",,,,,,,,,,,,,,,,,,,
-,"uid","pid","hidden","title","flag",,,,,,,,,,,,,,
-,1,0,0,"Dansk","dk",,,,,,,,,,,,,,
-,2,0,0,"Deutsch","de",,,,,,,,,,,,,,
-"tt_content",,,,,,,,,,,,,,,,,,,
-,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","header","image","tx_irretutorial_1nff_hotels","l10n_state",,,
-,297,89,256,0,0,0,0,0,0,0,0,0,"Regular Element #1",0,2,\NULL,,,
-,298,89,512,0,0,0,0,0,0,0,0,0,"Regular Element #2",0,0,\NULL,,,
-,299,89,1024,0,1,297,0,0,0,0,0,0,"Regular Element #1",0,2,"{""header"":""parent"",""tx_irretutorial_1nff_hotels"":""parent""}",,,
-,300,89,2048,0,1,298,0,0,0,0,0,0,"Regular Element #2++",0,1,"{""header"":""custom"",""tx_irretutorial_1nff_hotels"":""custom""}",,,
-"tx_irretutorial_1nff_hotel",,,,,,,,,,,,,,,,,,,
-,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","l18n_diffsource","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","title","parentid","parenttable","parentidentifier","offers","l10n_state"
-,2,89,1,0,0,0,,0,0,0,0,0,0,"Hotel #0",89,"pages",,0,\NULL
-,3,89,1,0,0,0,,0,0,0,0,0,0,"Hotel #1",297,"tt_content",,2,\NULL
-,4,89,514,0,0,0,,0,0,0,0,0,0,"Hotel #2",297,"tt_content",,1,\NULL
-,5,89,1,0,1,0,,0,0,0,0,0,0,"Hotel #3",300,"tt_content",,0,\NULL
-,6,89,1,0,1,3,,3,0,0,0,0,0,"[Translate to Dansk:] Hotel #1",299,"tt_content",,2,\NULL
-,7,89,2,0,1,4,,4,0,0,0,0,0,"[Translate to Dansk:] Hotel #2",299,"tt_content",,1,\NULL
-"tx_irretutorial_1nff_offer",,,,,,,,,,,,,,,,,,,
-,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","l18n_diffsource","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","title","parentid","parenttable","parentidentifier","prices","l10n_state"
-,5,89,1,0,0,0,,0,0,0,0,0,0,"Offer #1.1",3,"tx_irretutorial_1nff_hotel",,3,\NULL
-,6,89,1026,0,0,0,,0,0,0,0,0,0,"Offer #1.2",3,"tx_irretutorial_1nff_hotel",,2,\NULL
-,7,89,1,0,0,0,,0,0,0,0,0,0,"Offer #2.1",4,"tx_irretutorial_1nff_hotel",,1,\NULL
-,8,89,1,0,1,5,,5,0,0,0,0,0,"[Translate to Dansk:] Offer #1.1",6,"tx_irretutorial_1nff_hotel",,3,\NULL
-,9,89,514,0,1,6,,6,0,0,0,0,0,"[Translate to Dansk:] Offer #1.2",6,"tx_irretutorial_1nff_hotel",,2,\NULL
-,10,89,1,0,1,7,,7,0,0,0,0,0,"[Translate to Dansk:] Offer #2.1",7,"tx_irretutorial_1nff_hotel",,1,\NULL
-"tx_irretutorial_1nff_price",,,,,,,,,,,,,,,,,,,
-,"uid","pid","sorting","deleted","sys_language_uid","l18n_parent","l18n_diffsource","t3_origuid","t3ver_wsid","t3ver_state","t3ver_stage","t3ver_oid","t3ver_move_id","title","parentid","parenttable","parentidentifier","l10n_state",
-,7,89,1,0,0,0,,0,0,0,0,0,0,"Price #1.1.1",5,"tx_irretutorial_1nff_offer",,\NULL,
-,8,89,1538,0,0,0,,0,0,0,0,0,0,"Price #1.1.2",5,"tx_irretutorial_1nff_offer",,\NULL,
-,9,89,2563,0,0,0,,0,0,0,0,0,0,"Price #1.1.3",5,"tx_irretutorial_1nff_offer",,\NULL,
-,10,89,1,0,0,0,,0,0,0,0,0,0,"Price #1.2.1",6,"tx_irretutorial_1nff_offer",,\NULL,
-,11,89,1538,0,0,0,,0,0,0,0,0,0,"Price #1.2.2",6,"tx_irretutorial_1nff_offer",,\NULL,
-,12,89,1,0,0,0,,0,0,0,0,0,0,"Price #2.1.1",7,"tx_irretutorial_1nff_offer",,\NULL,
-,13,89,1,0,1,7,,7,0,0,0,0,0,"[Translate to Dansk:] Price #1.1.1",8,"tx_irretutorial_1nff_offer",,\NULL,
-,14,89,1026,0,1,8,,8,0,0,0,0,0,"[Translate to Dansk:] Price #1.1.2",8,"tx_irretutorial_1nff_offer",,\NULL,
-,15,89,1027,0,1,9,,9,0,0,0,0,0,"[Translate to Dansk:] Price #1.1.3",8,"tx_irretutorial_1nff_offer",,\NULL,
-,16,89,1,0,1,10,,10,0,0,0,0,0,"[Translate to Dansk:] Price #1.2.1",9,"tx_irretutorial_1nff_offer",,\NULL,
-,17,89,514,0,1,11,,11,0,0,0,0,0,"[Translate to Dansk:] Price #1.2.2",9,"tx_irretutorial_1nff_offer",,\NULL,
-,18,89,1,0,1,12,,12,0,0,0,0,0,"[Translate to Dansk:] Price #2.1.1",10,"tx_irretutorial_1nff_offer",,\NULL,
\ No newline at end of file
diff --git a/typo3/sysext/install/Tests/Functional/Updates/RowUpdater/L10nModeUpdaterTest.php b/typo3/sysext/install/Tests/Functional/Updates/RowUpdater/L10nModeUpdaterTest.php
deleted file mode 100644 (file)
index e8a2d7d..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-<?php
-namespace TYPO3\CMS\Install\Tests\Functional\Updates\RowUpdater;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Install\Updates\RowUpdater\L10nModeUpdater;
-use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
-
-/**
- * Test Class for L10nModeUpdater
- */
-class L10nModeUpdaterTest extends FunctionalTestCase
-{
-    /**
-     * @var string
-     */
-    protected $scenarioDataSetDirectory = 'typo3/sysext/install/Tests/Functional/Updates/RowUpdater/DataSet/';
-
-    /**
-     * @var string
-     */
-    protected $assertionDataSetDirectory = 'typo3/sysext/install/Tests/Functional/Updates/RowUpdater/DataSet/';
-
-    /**
-     * @var string[]
-     */
-    protected $coreExtensionsToLoad = [
-        'workspaces',
-    ];
-
-    /**
-     * @var string[]
-     */
-    protected $testExtensionsToLoad = [
-        'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/irre_tutorial',
-    ];
-
-    protected function setUp()
-    {
-        parent::setUp();
-        $this->importScenarioDataSet('LiveDefaultPages');
-        $this->importScenarioDataSet('LiveDefaultElements');
-
-        $GLOBALS['TCA']['tt_content']['columns']['image']['l10n_mode'] = 'exclude';
-        $GLOBALS['TCA']['tt_content']['columns']['header']['config']['behaviour']['allowLanguageSynchronization'] = true;
-        $GLOBALS['TCA']['tt_content']['columns']['tx_irretutorial_1nff_hotels']['config']['behaviour']['allowLanguageSynchronization'] = true;
-    }
-
-    /**
-     * @param string $dataSetName
-     */
-    protected function importScenarioDataSet($dataSetName)
-    {
-        $fileName = rtrim($this->scenarioDataSetDirectory, '/') . '/' . $dataSetName . '.csv';
-        $fileName = GeneralUtility::getFileAbsFileName($fileName);
-        $this->importCSVDataSet($fileName);
-    }
-
-    protected function assertAssertionDataSet($dataSetName)
-    {
-        $fileName = rtrim($this->assertionDataSetDirectory, '/') . '/' . $dataSetName . '.csv';
-        $fileName = GeneralUtility::getFileAbsFileName($fileName);
-        $this->assertCSVDataSet($fileName);
-    }
-
-    /**
-     * @return array
-     */
-    protected function getTableNames(): array
-    {
-        return array_keys($GLOBALS['TCA']);
-    }
-
-    /**
-     * @test
-     */
-    public function recordsCanBeUpdated()
-    {
-        $updater = new L10nModeUpdater();
-        foreach ($this->getTableNames() as $tableName) {
-            $updater->hasPotentialUpdateForTable($tableName);
-            foreach ($this->getAllRecords($tableName) as $record) {
-                $updater->updateTableRow($tableName, $record);
-            }
-        }
-
-        $this->assertAssertionDataSet('recordsCanBeUpdated');
-    }
-}
diff --git a/typo3/sysext/install/Tests/Unit/Updates/Compatibility7ExtractionUpdateTest.php b/typo3/sysext/install/Tests/Unit/Updates/Compatibility7ExtractionUpdateTest.php
deleted file mode 100644 (file)
index e1934f2..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-<?php
-declare(strict_types = 1);
-namespace TYPO3\CMS\Install\Tests\Unit\Updates;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Registry;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Extbase\Object\ObjectManager;
-use TYPO3\CMS\Extensionmanager\Utility\InstallUtility;
-use TYPO3\CMS\Extensionmanager\Utility\ListUtility;
-use TYPO3\CMS\Install\Updates\Compatibility7ExtractionUpdate;
-use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
-
-/**
- * Test case
- */
-class Compatibility7ExtractionUpdateTest extends UnitTestCase
-{
-    /**
-     * @var Registry
-     */
-    protected $registry;
-
-    /**
-     * Set up
-     */
-    protected function setUp()
-    {
-        $this->registry = $this->prophesize(Registry::class);
-        GeneralUtility::setSingletonInstance(Registry::class, $this->registry->reveal());
-    }
-
-    /**
-     * Tear down
-     */
-    protected function tearDown()
-    {
-        GeneralUtility::purgeInstances();
-        parent::tearDown();
-    }
-
-    /**
-     * @test
-     */
-    public function checkForUpdateReturnsTrueIfWizardIsNotMarkedAsDoneYet()
-    {
-        $this->registry->get('installUpdate', Compatibility7ExtractionUpdate::class, false)->willReturn(false);
-        $subject = new Compatibility7ExtractionUpdate();
-        $this->assertTrue($subject->updateNecessary());
-    }
-
-    /**
-     * @test
-     */
-    public function performUpdateInstallsExtensionUponRequest()
-    {
-        $objectManager = $this->prophesize(ObjectManager::class);
-        GeneralUtility::setSingletonInstance(ObjectManager::class, $objectManager->reveal());
-
-        $listUtility = $this->prophesize(ListUtility::class);
-        $installUtility = $this->prophesize(InstallUtility::class);
-        $objectManager->get(InstallUtility::class)->willReturn($installUtility->reveal());
-        $objectManager->get(ListUtility::class)->willReturn($listUtility->reveal());
-        $extensionList = ['compatibility7' => ['foo' => 'bar']];
-        $listUtility->getAvailableExtensions()->willReturn($extensionList);
-        $listUtility->getAvailableAndInstalledExtensions($extensionList)->willReturn($extensionList);
-
-        $subject = new Compatibility7ExtractionUpdate();
-        $this->assertTrue($subject->executeUpdate());
-
-        $installUtility->install('compatibility7')->shouldHaveBeenCalled();
-    }
-}
diff --git a/typo3/sysext/install/Tests/Unit/Updates/RowUpdater/L10nModeUpdaterTest.php b/typo3/sysext/install/Tests/Unit/Updates/RowUpdater/L10nModeUpdaterTest.php
deleted file mode 100644 (file)
index 7583db8..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-<?php
-declare(strict_types = 1);
-namespace TYPO3\CMS\Install\Tests\Unit\Updates\RowUpdater;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use Prophecy\Argument;
-use TYPO3\CMS\Core\Database\ConnectionPool;
-use TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder;
-use TYPO3\CMS\Core\Database\Query\QueryBuilder;
-use TYPO3\CMS\Core\Database\Query\Restriction\QueryRestrictionContainerInterface;
-use TYPO3\CMS\Core\Tests\Unit\Resource\BaseTestCase;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Install\Updates\RowUpdater\L10nModeUpdater;
-
-/**
- * Test Class for ContentTypesToTextMediaUpdate
- */
-class L10nModeUpdaterTest extends BaseTestCase
-{
-    /**
-     * @test
-     */
-    public function hasPotentialUpdateForTableThrowsExceptionIfGlobalsTcaTableArrayIsNotSet()
-    {
-        $this->expectException(\RuntimeException::class);
-        $this->expectExceptionCode(1484176136);
-        $GLOBALS['TCA'] = [];
-        (new L10nModeUpdater())->hasPotentialUpdateForTable('someTable');
-    }
-
-    /**
-     * @test
-     */
-    public function hasPotentialUpdateForTableThrowsExceptionIfGlobalsTcaTableArrayIsNotAnArray()
-    {
-        $this->expectException(\RuntimeException::class);
-        $this->expectExceptionCode(1484176136);
-        $GLOBALS['TCA'] = ['someTable' => ''];
-        (new L10nModeUpdater())->hasPotentialUpdateForTable('someTable');
-    }
-
-    /**
-     * @test
-     */
-    public function hasPotentialUpdateForTableReturnFalseForTableWithoutL10nMode()
-    {
-        $GLOBALS['TCA'] = [
-            'testTable' => [
-                'ctrl' => [
-                    'languageField' => 'sys_language_uid',
-                    'transOrigPointerField' => 'l10n_parent',
-                ],
-                'columns' => [
-                    'testField' => [
-                        'label' => 'someLabel',
-                        'config' => [
-                            'type' => 'input',
-                        ],
-                    ],
-                ],
-            ],
-        ];
-        $subject = new L10nModeUpdater();
-        $this->assertFalse($subject->hasPotentialUpdateForTable('testTable'));
-    }
-
-    /**
-     * @test
-     */
-    public function hasPotentialUpdateForTableReturnTrueForTableWithL10nModeExclude()
-    {
-        $GLOBALS['TCA'] = [
-            'testTable' => [
-                'ctrl' => [
-                    'languageField' => 'sys_language_uid',
-                    'transOrigPointerField' => 'l10n_parent',
-                ],
-                'columns' => [
-                    'testField' => [
-                        'label' => 'someLabel',
-                        'l10n_mode' => 'exclude',
-                        'config' => [
-                            'type' => 'input',
-                        ],
-                    ],
-                ],
-            ],
-        ];
-
-        $connectionPoolProphecy = $this->prophesize(ConnectionPool::class);
-        GeneralUtility::addInstance(ConnectionPool::class, $connectionPoolProphecy->reveal());
-        $queryBuilderProphecy = $this->prophesize(QueryBuilder::class);
-        $connectionPoolProphecy->getQueryBuilderForTable('testTable')->willReturn($queryBuilderProphecy->reveal());
-        $restrictionBuilderProphecy = $this->prophesize(QueryRestrictionContainerInterface::class);
-        $queryBuilderProphecy->getRestrictions()->willReturn($restrictionBuilderProphecy->reveal());
-        $queryBuilderProphecy->from('testTable');
-        $expressionBuilderProphecy = $this->prophesize(ExpressionBuilder::class);
-        $queryBuilderProphecy->expr()->willReturn($expressionBuilderProphecy->reveal());
-        $queryBuilderProphecy->createNamedParameter(Argument::cetera())->willReturnArgument(0);
-        $expressionBuilderProphecy->gt('sys_language_uid', 0);
-        $expressionBuilderProphecy->gt('l10n_parent', 0);
-        $queryBuilderProphecy->select('uid', 'l10n_parent')->willReturn($queryBuilderProphecy->reveal());
-        $queryBuilderProphecy->andWhere(Argument::cetera())->willReturn($queryBuilderProphecy->reveal());
-        $queryBuilderProphecy->execute()->willReturn([
-            [
-                'uid' => 23,
-                'l10n_parent' => 42,
-            ]
-        ]);
-
-        $subject = new L10nModeUpdater();
-        $this->assertTrue($subject->hasPotentialUpdateForTable('testTable'));
-    }
-
-    /**
-     * @test
-     */
-    public function hasPotentialUpdateForTableReturnTrueForTableWithBehaviourAllowLanguageSynchronization()
-    {
-        $GLOBALS['TCA'] = [
-            'testTable' => [
-                'ctrl' => [
-                    'languageField' => 'sys_language_uid',
-                    'transOrigPointerField' => 'l10n_parent',
-                ],
-                'columns' => [
-                    'testField' => [
-                        'label' => 'someLabel',
-                        'config' => [
-                            'type' => 'input',
-                            'behaviour' => [
-                                'allowLanguageSynchronization' => true,
-                            ]
-                        ],
-                    ],
-                ],
-            ],
-        ];
-
-        $connectionPoolProphecy = $this->prophesize(ConnectionPool::class);
-        GeneralUtility::addInstance(ConnectionPool::class, $connectionPoolProphecy->reveal());
-        $queryBuilderProphecy = $this->prophesize(QueryBuilder::class);
-        $connectionPoolProphecy->getQueryBuilderForTable('testTable')->willReturn($queryBuilderProphecy->reveal());
-        $restrictionBuilderProphecy = $this->prophesize(QueryRestrictionContainerInterface::class);
-        $queryBuilderProphecy->getRestrictions()->willReturn($restrictionBuilderProphecy->reveal());
-        $queryBuilderProphecy->from('testTable');
-        $expressionBuilderProphecy = $this->prophesize(ExpressionBuilder::class);
-        $queryBuilderProphecy->expr()->willReturn($expressionBuilderProphecy->reveal());
-        $expressionBuilderProphecy = $this->prophesize(ExpressionBuilder::class);
-        $queryBuilderProphecy->expr()->willReturn($expressionBuilderProphecy->reveal());
-        $queryBuilderProphecy->createNamedParameter(Argument::cetera())->willReturnArgument(0);
-        $expressionBuilderProphecy->gt('sys_language_uid', 0);
-        $expressionBuilderProphecy->gt('l10n_parent', 0);
-        $queryBuilderProphecy->select('uid', 'l10n_parent')->willReturn($queryBuilderProphecy->reveal());
-        $queryBuilderProphecy->andWhere(Argument::cetera())->willReturn($queryBuilderProphecy->reveal());
-        $queryBuilderProphecy->execute()->willReturn([
-            [
-                'uid' => 23,
-                'l10n_parent' => 42,
-            ]
-        ]);
-
-        $subject = new L10nModeUpdater();
-        $this->assertTrue($subject->hasPotentialUpdateForTable('testTable'));
-    }
-}
index 90162ed..042e68a 100644 (file)
@@ -5,43 +5,11 @@ defined('TYPO3_MODE') or die();
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['extensionManagerTables']
     = \TYPO3\CMS\Install\Updates\ExtensionManagerTables::class;
 
-// TYPO3 CMS 8
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['wizardDoneToRegistry']
-    = \TYPO3\CMS\Install\Updates\WizardDoneToRegistry::class;
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['startModuleUpdate']
-    = \TYPO3\CMS\Install\Updates\StartModuleUpdate::class;
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['frontendUserImageUpdateWizard']
-    = \TYPO3\CMS\Install\Updates\FrontendUserImageUpdateWizard::class;
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['databaseRowsUpdateWizard']
-    = \TYPO3\CMS\Install\Updates\DatabaseRowsUpdateWizard::class;
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['commandLineBackendUserRemovalUpdate']
-    = \TYPO3\CMS\Install\Updates\CommandLineBackendUserRemovalUpdate::class;
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['fillTranslationSourceField']
-    = \TYPO3\CMS\Install\Updates\FillTranslationSourceField::class;
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['sectionFrameToFrameClassUpdate']
-    = \TYPO3\CMS\Install\Updates\SectionFrameToFrameClassUpdate::class;
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['splitMenusUpdate']
-    = \TYPO3\CMS\Install\Updates\SplitMenusUpdate::class;
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['bulletContentElementUpdate']
-    = \TYPO3\CMS\Install\Updates\BulletContentElementUpdate::class;
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['uploadContentElementUpdate']
-    = \TYPO3\CMS\Install\Updates\UploadContentElementUpdate::class;
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['migrateFscStaticTemplateUpdate']
-    = \TYPO3\CMS\Install\Updates\MigrateFscStaticTemplateUpdate::class;
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['fileReferenceUpdate']
-    = \TYPO3\CMS\Install\Updates\FileReferenceUpdate::class;
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['migrateFeSessionDataUpdate']
-    = \TYPO3\CMS\Install\Updates\MigrateFeSessionDataUpdate::class;
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['compatibility7Extension']
-    = \TYPO3\CMS\Install\Updates\Compatibility7ExtractionUpdate::class;
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['formLegacyExtractionUpdate']
-    = \TYPO3\CMS\Install\Updates\FormLegacyExtractionUpdate::class;
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['rtehtmlareaExtension']
-    = \TYPO3\CMS\Install\Updates\RteHtmlAreaExtractionUpdate::class;
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['sysLanguageSorting']
-    = \TYPO3\CMS\Install\Updates\LanguageSortingUpdate::class;
+// Update rows of many tables - Enable if new row updaters are needed again.
+//$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['databaseRowsUpdateWizard']
+//    = \TYPO3\CMS\Install\Updates\DatabaseRowsUpdateWizard::class;
 
-// Add update wizards below this line
+// v8->v9 wizards below this line
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['typo3DbLegacyExtension']
     = \TYPO3\CMS\Install\Updates\Typo3DbExtractionUpdate::class;
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['funcExtension']
@@ -69,6 +37,8 @@ $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['pagesSlugs']
 $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/install']['update']['argon2iPasswordHashes']
     = \TYPO3\CMS\Install\Updates\Argon2iPasswordHashes::class;
 
+// v9->v10 wizards below this line
+
 $iconRegistry = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Imaging\IconRegistry::class);
 $icons = [
     'module-install-environment' => 'EXT:install/Resources/Public/Icons/module-install-environment.svg',