Project

General

Profile

Actions

Bug #89020

closed

Unknown column 'newlyCreated' in 'field list'

Added by This Mächler over 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2019-08-26
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.3
Tags:
newlyCreated sys_file_metadata workspace
Complexity:
Is Regression:
Sprint Focus:

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?


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #62829: FAL not generating sys_file_metadata correctlyClosed2014-11-10

Actions
Actions #1

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.

Actions #2

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.

Actions #3

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.

Actions #4

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,
];
Actions #5

Updated by Oliver Hader about 4 years ago

  • Category set to File Abstraction Layer (FAL)
Actions #6

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).

Actions #7

Updated by Oliver Hader about 4 years ago

  • Related to Bug #62829: FAL not generating sys_file_metadata correctly added
Actions #8

Updated by Georg Ringer about 4 years ago

  • Status changed from New to Accepted
Actions #9

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

Actions #10

Updated by Benni Mack about 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #11

Updated by Benni Mack about 4 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF