Project

General

Profile

Actions

Bug #50802

closed

FolderBasedFileCollection::loadContents() doesn't check if folder is present

Added by Frans Saris over 11 years ago. Updated about 6 years ago.

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

100%

Estimated time:
TYPO3 Version:
6.1
PHP Version:
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

Description

in FolderBasedFileCollection::loadContents() there is no check if the folder object is present this can result in a fatal error.

    Call to a member function getFiles() on a non-object in typo3/sysext/core/Classes/Resource/Collection/FolderBasedFileCollection.php on line 73

*example usage:

            /** @var $fileCollection \TYPO3\CMS\Core\Resource\Collection\AbstractFileCollection */
            $fileCollection = $this->fileCollectionRepository->findByUid($this->getUid());
            $fileCollection->loadContents();
            $this->assets = $fileCollection->getItems();

There is no way to check if the initialization of the object was successful so you currently can not prevent the error.

Fix:
Check in FolderBasedFileCollection::loadContents() if $this->folder is initialized.

Actions #1

Updated by Gerrit Code Review over 11 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/22829

Actions #2

Updated by Ernesto Baschny over 11 years ago

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

Updated by Gerrit Code Review about 11 years ago

Patch set 2 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/22829

Actions #4

Updated by Gerrit Code Review about 11 years ago

Patch set 3 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/22829

Actions #5

Updated by Gerrit Code Review about 11 years ago

Patch set 1 for branch TYPO3_6-1 has been pushed to the review server.
It is available at https://review.typo3.org/24781

Actions #6

Updated by Gerrit Code Review about 11 years ago

Patch set 1 for branch TYPO3_6-0 has been pushed to the review server.
It is available at https://review.typo3.org/24782

Actions #7

Updated by Frans Saris about 11 years ago

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

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF