Feature #45498

Find best-matching local storage instead of default-storage

Added by Stefan Neufeind almost 9 years ago. Updated about 3 years ago.

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

100%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

If a "legacy" file/folder is to be accessed (no storage-uid given) usually the default-storage will be used. But for example the Filelist-module will default to using the auto-created fileadmin-storage (Local-driver). All files added/changed will be indexed in sys_file for that respective storage and not the default-storage (ID 0). So we save us a lot of trouble to also try to use a best-matching storage (fileadmin or maybe also for other paths) instead of using the default-storage (legacy-storage).


Related issues

Blocks TYPO3 Core - Bug #52173: Wrong storage is selected if file is outside of available storagesClosed2013-09-22

Actions
#1

Updated by Gerrit Code Review almost 9 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/18290

#2

Updated by Gerrit Code Review over 8 years ago

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

#3

Updated by Gerrit Code Review over 8 years ago

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

#4

Updated by Gerrit Code Review over 8 years ago

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

#5

Updated by Gerrit Code Review over 8 years ago

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

#6

Updated by Gerrit Code Review over 8 years ago

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

#7

Updated by Gerrit Code Review over 8 years ago

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

#8

Updated by Gerrit Code Review over 8 years ago

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

#9

Updated by Gerrit Code Review over 8 years ago

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

#10

Updated by Stefan Neufeind over 8 years ago

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

Updated by Gerrit Code Review over 8 years ago

  • Status changed from Resolved to Under Review

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

#12

Updated by Gerrit Code Review over 8 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/23292

#13

Updated by Gerrit Code Review about 8 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/23557

#14

Updated by Gerrit Code Review about 8 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/23560

#15

Updated by Gerrit Code Review about 8 years ago

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

#16

Updated by Gerrit Code Review about 8 years ago

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

#17

Updated by Gerrit Code Review about 8 years ago

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

#18

Updated by Gerrit Code Review about 8 years ago

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

#19

Updated by Stefan Neufeind about 8 years ago

  • Status changed from Under Review to Resolved
#20

Updated by aimcom no-lastname-given about 8 years ago

In one of my TYPO3 projects, I ran into a major issue which is related to this new method findBestMatchingStorageByLocalPath(&$localPath). The image rendering doesn't work any more if an image is not located in one of the configured file storages.

Example

I have configured two different file storages: fileadmin/user_upload/ and uploads/. After that, I created an empty page with a TypoScript template which contains:

page.10 = IMAGE
page.10.file = fileadmin/images/dummy.png

In TYPO3 6.1.4, the method getFileObjectFromCombinedIdentifier($identifier) returned the correct file object, but in TYPO3 6.1.5, this doesn't work any more because the method findBestMatchingStorageByLocalPath(&$localPath) returns the file storage for fileadmin/user_upload/, but the image is located in fileadmin/images/.

Question / Conclusion

What I don't know now is if this is a bug or not. Is it true that you can only use files with the cObject IMAGE if they are located in a local storage since TYPO3 6.1.5 or is there something wrong with the functionality of findBestMatchingStorageByLocalPath(&$localPath)? I think that the call of PathUtility::getCommonPrefix(array($basePath, $localPath)); in findBestMatchingStorageByLocalPath(&$localPath) might be the source of my problem.

Any help is appreciated, thank you.

#21

Updated by Markus Klein about 8 years ago

The findBestMatchingStorageByLocalPath() method simply does not check whether the file requested actually exists in the selected storage!

#22

Updated by Markus Klein about 8 years ago

Moved to a separate issue: http://forge.typo3.org/issues/52173

#23

Updated by Benni Mack about 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF