Task #53688

Epic #55070: Workpackages

Epic #54260: WP: FAL Missing Issues / Features / API

Story #54263: As an Integrator I want to have my metadata present at places when using files

Task #52778: No metadata shown for Folder and Category bases collections

ResourceFactory::createFileObject is called from Folder::getFiles directly

Added by Steffen Ritter about 6 years ago. Updated about 2 years ago.

Status:
Closed
Priority:
Must have
Category:
File Abstraction Layer (FAL)
Target version:
Start date:
2014-01-01
Due date:
2014-02-15
% Done:

100%

Estimated time:
3.00 h
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
medium
Sprint Focus:

Description

sysext/core/Resource/Folder::getFiles directly collects the files from the driver (very expensive!) and creates FileObjects directly.
These FileObjects do not know of their index record!

The method has to be restructered. With method FileIndexRepository::findByFolder (introduced with #53687) the folder's index records can be retrieved.
  • The driver already provides a method that only returns the existing identifiers instead of extracting the file's data.
  • In case the IndexRecord is already present, the method calls ResourceFactory::getFile($uid, $indexRecord) otherwise ResourceFactory::getFileObjectByStorageAndIdentifier() is used.

Related issues

Follows TYPO3 Core - Task #53687: FileRepository:getFileIndexRecordsForFolder only works for hierarchical path Closed 2013-11-16 2013-12-31

Associated revisions

Revision 28b91ac6 (diff)
Added by Steffen Ritter about 6 years ago

[BUGFIX] Folder::getFiles directly calls Factory::createFileObject

Folder::getFiles implements the logic of creating file objects
itself, after retrieving the information from the driver.
Besides the fact that this is slow since all information for the
object are received from the filesystem directly instead of the
cache in the sys_file table the uid is not present in these
objects which finally results in the lack of metadata in these
file objects.

In addition to that ommiting the ResourceFactory several objects
for the same file might exists which may lead to inconsistent
behaviour and output on modifying the file.

As the Folder/File Objects only should be a convinience facade
in front of the ResourceStorage this change introduces a new
method their, implementing the new and improved logic.

At the same time the old functionality - which enforces manual
file object creation - has been deprecated and the filelist
module is adapted accordingly.

Releases: 6.2
Resolves: #53688
Change-Id: I3fb97d432d325bd6400c0ae208b90d702c9f528d
Reviewed-on: https://review.typo3.org/26360
Reviewed-by: Frans Saris
Tested-by: Frans Saris
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter

History

#1 Updated by Steffen Ritter about 6 years ago

  • Assignee set to Steffen Ritter

#2 Updated by Steffen Ritter about 6 years ago

  • Tracker changed from Bug to Task
  • Due date set to 2013-12-31
  • Estimated time set to 3.00 h
  • translation missing: en.field_remaining_hours set to 3.0
  • Complexity set to medium

#3 Updated by Steffen Ritter about 6 years ago

  • % Done changed from 0 to 10

#4 Updated by Gerrit Code Review about 6 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/26360

#5 Updated by Steffen Ritter about 6 years ago

  • % Done changed from 10 to 70

#6 Updated by Steffen Ritter about 6 years ago

  • % Done changed from 70 to 90

#7 Updated by Steffen Ritter about 6 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 90 to 100

#8 Updated by Steffen Ritter about 6 years ago

  • % Done changed from 100 to 90

#9 Updated by Steffen Ritter almost 6 years ago

  • % Done changed from 90 to 100

#10 Updated by Riccardo De Contardi about 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF