diff --git a/typo3/sysext/core/Classes/Resource/Index/MetaDataRepository.php b/typo3/sysext/core/Classes/Resource/Index/MetaDataRepository.php index 57ae7e7002d98c9b13e914d52d7765818b97f449..c2e26c9addf2e55739e1cf3305ab1ea7439b1da8 100644 --- a/typo3/sysext/core/Classes/Resource/Index/MetaDataRepository.php +++ b/typo3/sysext/core/Classes/Resource/Index/MetaDataRepository.php @@ -74,7 +74,9 @@ class MetaDataRepository implements SingletonInterface // created and inserted into the database. If this is the case // we have to take care about correct meta information for width and // height in case of an image. - if (!empty($record['newlyCreated'])) { + // This logic can be transferred into a custom PSR-14 event listener in the future by just using + // the AfterMetaDataCreated event. + if (!empty($record['crdate']) && (int)$record['crdate'] === $GLOBALS['EXEC_TIME']) { if ($file->getType() === File::FILETYPE_IMAGE && $file->getStorage()->getDriverType() === 'Local') { $fileNameAndPath = $file->getForLocalProcessing(false); @@ -157,7 +159,6 @@ class MetaDataRepository implements SingletonInterface $record = $emptyRecord; $record['uid'] = $connection->lastInsertId($this->tableName); - $record['newlyCreated'] = true; return $this->eventDispatcher->dispatch(new AfterFileMetaDataCreatedEvent($fileUid, (int)$record['uid'], $record))->getRecord(); } diff --git a/typo3/sysext/core/Tests/Unit/Resource/MetaDataAspectTest.php b/typo3/sysext/core/Tests/Unit/Resource/MetaDataAspectTest.php index ff4dbf4d254dcaf79ec6c5ee575cdeb5db72dc27..e720b3af5966b610a4c7273a44a4c6c61ce3487d 100644 --- a/typo3/sysext/core/Tests/Unit/Resource/MetaDataAspectTest.php +++ b/typo3/sysext/core/Tests/Unit/Resource/MetaDataAspectTest.php @@ -178,7 +178,6 @@ class MetaDataAspectTest extends UnitTestCase 'l10n_diffsource' => '', 'title' => 'Hooray', 'uid' => '5', - 'newlyCreated' => true, ]; self::assertSame($expected, $file->getMetaData()->get()); diff --git a/typo3/sysext/core/Tests/Unit/Type/File/FileInfoTest.php b/typo3/sysext/core/Tests/Unit/Type/File/FileInfoTest.php deleted file mode 100644 index 6adef4c2c7d648217d7aff44f41e327ebc2e9aba..0000000000000000000000000000000000000000 --- a/typo3/sysext/core/Tests/Unit/Type/File/FileInfoTest.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php -namespace TYPO3\CMS\Core\Tests\Unit\Type\File; - -/* - * 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\TestingFramework\Core\Unit\UnitTestCase; - -/** - * Test case - */ -class FileInfoTest extends UnitTestCase -{ - /** - * @test - */ - public function classFileInfoCanBeInstantiated() - { - $className = 'TYPO3\CMS\Core\Type\File\FileInfo'; - $classInstance = new \TYPO3\CMS\Core\Type\File\FileInfo('FooFileName'); - self::assertInstanceOf($className, $classInstance); - } -}