Bug #89020
closedUnknown column 'newlyCreated' in 'field list'
100%
Description
Situation:
Edit a record in draft workspace (record with IRRE elements insinde, don't know if this matters).
After saving and reloading the frontend, I get this error in the FE:
An exception occurred while executing 'SELECT `file`, `pid`, `crdate`, `tstamp`, `cruser_id`, `l10n_diffsource`, `uid`, `newlyCreated` FROM `sys_file_metadata` WHERE (`pid` = ?) AND (`t3ver_oid` = ?) AND (`t3ver_wsid` = ?) LIMIT 1' with params [-1, 5721, 1]: Unknown column 'newlyCreated' in 'field list'
Doctrine\DBAL\Exception\InvalidFieldNameException thrown in file
/home/clients/d093324e36a4e035ed2439efe5bbc89e/dev/typo3_src-8.7.27/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php in line 71.
Stack trace:
50 TYPO3\CMS\Extbase\Service\ImageService::getImage("uploads/tx_dfimageblog/wbw_7-8-2016_02.jpg", NULL, boolean)
51 TYPO3\CMS\Extbase\Service\ImageService::getImageFromSourceString("uploads/tx_dfimageblog/wbw_7-8-2016_02.jpg", boolean)
52 TYPO3\CMS\Core\Resource\ResourceFactory::retrieveFileOrFolderObject("uploads/tx_dfimageblog/wbw_7-8-2016_02.jpg")
53 TYPO3\CMS\Core\Resource\ResourceFactory::getFileObjectFromCombinedIdentifier("uploads/tx_dfimageblog/wbw_7-8-2016_02.jpg")
TYPO3\CMS\Core\Resource\ResourceFactory::getFileObjectByStorageAndIdentifier(0, "uploads/tx_dfimageblog/wbw_7-8-2016_02.jpg")
55 TYPO3\CMS\Core\Resource\Index\Indexer::createIndexEntry("uploads/tx_dfimageblog/wbw_7-8-2016_02.jpg")
...
...
...
60 TYPO3\CMS\Extbase\SignalSlot\Dispatcher::dispatch("TYPO3\CMS\Core\Resource\Index\MetaDataRepository", "recordPostRetrieval", array)
61 call_user_func_array(array, array)
62 TYPO3\CMS\Frontend\Aspect\FileMetadataOverlayAspect::languageAndWorkspaceOverlay(ArrayObject, "TYPO3\CMS\Core\Resource\Index\MetaDataRepository::recordPostRetrieval")
63 TYPO3\CMS\Frontend\Page\PageRepository::versionOL("sys_file_metadata", array)
64 TYPO3\CMS\Frontend\Page\PageRepository::getWorkspaceVersionOfRecord(1, "sys_file_metadata", 5721, "file,pid,crdate,tstamp,cruser_id,l10n_diffsource,uid,newlyCreated", boolean)
65 TYPO3\CMS\Core\Database\Query\QueryBuilder::execute()
66 Doctrine\DBAL\Query\QueryBuilder::execute()
67 Doctrine\DBAL\Connection::executeQuery("SELECT `file`, `pid`, `crdate`, `tstamp`, `cruser_…D (`t3ver_oid` = ?) AND (`t3ver_wsid` = ?) LIMIT 1", array, array)
When I move to other Modules in the Backend, or clear the cache (needs two actions sometimes), the error disapears.
Should the table 'sys_file_metadata' have a field 'newlyCreated'? I ran the Database analyzer, everything seems to be OK. What can I do?
Updated by This Mächler over 4 years ago
When I move to other Modules in the Backend, or clear the cache (needs two actions sometimes), the error disapears.
Update: the error disapears after certain (2 or 3) reloads of the frontend. Without clearing any cache.
Updated by This Mächler over 4 years ago
UPDATE:
The bug only appears after creating new workspace versions. Editing and saving existing workspace versions don't produce the bug in the frontend.
Updated by This Mächler over 4 years ago
UPDATE:
The bug also does not appear if I directly edit the inline record (that refers the images). Only if I edit the record that contains the inline record.
Updated by This Mächler over 4 years ago
In the source code I can find two appearances of 'newlyCreated'
In 'typo3/sysext/core/Classes/Resource/Index/MetaDataRepository.php', line 64:
if (!empty($record['newlyCreated'])) {
if ($file->getType() === File::FILETYPE_IMAGE && $file->getStorage()->getDriverType() === 'Local'){
...
}
In 'typo3/sysext/core/Tests/Unit/Resource/MetaDataAspectTest.php', line 175:
...
'uid' => '5',
'newlyCreated' => true,
];
Updated by Oliver Hader about 4 years ago
- Category set to File Abstraction Layer (FAL)
Updated by Oliver Hader about 4 years ago
It's not related to workspaces, but to a general flaw in mentioned MetaDataRepository
which has been introduced in https://review.typo3.org/c/Packages/TYPO3.CMS/+/33990/8/typo3/sysext/core/Classes/Resource/Index/MetaDataRepository.php
It looks like newlyCreated
should have been used as transient flag during runtime - however it ends up being used for database queries (which is wrong).
Updated by Oliver Hader about 4 years ago
- Related to Bug #62829: FAL not generating sys_file_metadata correctly added
Updated by Gerrit Code Review about 4 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/63874
Updated by Benni Mack about 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 037cac07bcafa2ba83a2ca058f8ca6ca7104bed7.