Find best-matching local storage instead of default-storage
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).
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.
I have configured two different file storages:
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
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.