Bug #78896

Replace file feature for FAL file list - doesn't work if storage id is not 1

Added by Dragan Tomic over 2 years ago. Updated over 2 years ago.

Status:
Rejected
Priority:
Must have
Assignee:
-
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2016-12-06
Due date:
% Done:

0%

TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

There is an error in the REPLACE file feature in FAL.
System storage UID is hard-coded to 1.

typo3/sysext/core/Classes/Utility/File/ ExtendedFileUtility.php line 1076:
$folder = $resourceFactory->getFolderObjectFromCombinedIdentifier('1:'.$fileObject->getParentFolder()->getIdentifier());

In big percentage, we are using auto created 'fileadmin' but here is obvious that this code will not work for any other Storage except fileadmin with UID 1.
Here I would read the storage from file object.

If you have situation like on picture attached this will not work for you.

Please check provided patch.

Screen Shot 2016-12-06 at 09.48.15.png View - System Storage where you can reproduce the error (23.7 KB) Dragan Tomic, 2016-12-06 10:04

patch_file_replace.diff View - Patch file (1.68 KB) Dragan Tomic, 2016-12-06 10:04


Related issues

Related to TYPO3 Core - Feature #56133: Replace file feature for fal file list Closed 2014-02-19

History

#1 Updated by Frans Saris over 2 years ago

Tnx for finding this. IMO after a quick look $folder = $fileObject->getParentFolder() should be sufficient.

Could you test that please and maybe push a patch to our review system?

#2 Updated by Frans Saris over 2 years ago

  • Status changed from New to Needs Feedback

What version are you using? Can find this in the our current 6.2 branch. Also the linked change doesn't have this code.

#3 Updated by Dragan Tomic over 2 years ago

Frans Saris wrote:

What version are you using? Can find this in the our current 6.2 branch. Also the linked change doesn't have this code.

Ah sorry, now I saw that this is accepted first in version 7.x :(
We have it in our internal Typo3 source which we sync with official but I see it is accepted as feature in next major release.

Since we have connection to the original Ticket with implementation https://forge.typo3.org/issues/56133 maybe someone can still use it :)

#4 Updated by Frans Saris over 2 years ago

  • Status changed from Needs Feedback to Rejected

Ok, tnx for the feedback. Closed this issue.

But if I understand you correctly this is in one of the older versions of TYPO3? Or only in your custom version?

Because $folder = $resourceFactory->getFolderObjectFromCombinedIdentifier('1:'.$fileObject->getParentFolder()->getIdentifier()); is a very strange construction that shouldn't be used any where in the core.

Also available in: Atom PDF