Skip to content
Snippets Groups Projects
Commit d0a24912 authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[TASK] Simplify ImageCropUpdater

The ImageCropUpdater of the install tool does not need the
not-yet-migrated TCA it does not rely on any TCA that may
have changed. Remove that section from the code.

Change-Id: I8ed4190fd53d87f368c978b183b99b562dba9444
Resolves: #79951
Releases: master
Reviewed-on: https://review.typo3.org/51792


Reviewed-by: default avatarHelmut Hummel <typo3@helhum.io>
Tested-by: default avatarHelmut Hummel <typo3@helhum.io>
Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarMona Muzaffar <mona.muzaffar@gmx.de>
Tested-by: default avatarMona Muzaffar <mona.muzaffar@gmx.de>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 767d7cfc
No related merge requests found
......@@ -21,7 +21,6 @@ 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;
use TYPO3\CMS\Install\Service\LoadTcaService;
/**
* Migrate values for database records having columns
......@@ -29,16 +28,6 @@ use TYPO3\CMS\Install\Service\LoadTcaService;
*/
class ImageCropUpdater implements RowUpdaterInterface
{
/**
* @var array Full, migrated TCA as prepared by upgrade wizard controller
*/
protected $migratedTca;
/**
* @var array Full, but NOT migrated TCA
*/
protected $notMigratedTca;
/**
* List of tables with information about to migrate fields.
* Created during hasPotentialUpdateForTable(), used in updateTableRow()
......@@ -47,18 +36,6 @@ class ImageCropUpdater implements RowUpdaterInterface
*/
protected $payload = [];
/**
* Prepare non-migrated TCA to be used in 'hasPotentialUpdateForTable' step
*/
public function __construct()
{
$this->migratedTca = $GLOBALS['TCA'];
$loadTcaService = GeneralUtility::makeInstance(LoadTcaService::class);
$loadTcaService->loadExtensionTablesWithoutMigration();
$this->notMigratedTca = $GLOBALS['TCA'];
$GLOBALS['TCA'] = $this->migratedTca;
}
/**
* Get title
*
......@@ -77,14 +54,12 @@ class ImageCropUpdater implements RowUpdaterInterface
*/
public function hasPotentialUpdateForTable(string $tableName): bool
{
$GLOBALS['TCA'] = $this->notMigratedTca;
$result = false;
$payload = $this->getPayloadForTable($tableName);
if (count($payload) !== 0) {
$this->payload[$tableName] = $payload;
$result = true;
}
$GLOBALS['TCA'] = $this->migratedTca;
return $result;
}
......@@ -217,7 +192,7 @@ class ImageCropUpdater implements RowUpdaterInterface
}
if (MathUtility::canBeInterpretedAsInteger($fileUid)) {
try {
$file = ResourceFactory::getInstance()->getFileObject($fileUid);
$file = ResourceFactory::getInstance()->getFileObject((int)$fileUid);
} catch (FileDoesNotExistException $e) {
} catch (\InvalidArgumentException $e) {
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment