[BUGFIX] Capability check fails for some storage types 47/42547/2
authorBenjamin Mack <benni@typo3.org>
Wed, 12 Aug 2015 19:37:15 +0000 (21:37 +0200)
committerBenni Mack <benni@typo3.org>
Wed, 12 Aug 2015 19:37:55 +0000 (21:37 +0200)
The check should only complain if a user wants to mark a storage as
public and the driver does not support that. This commit changes the
check accordingly.

Change-Id: Id5d029dbbb2c99b373af9ff41aa6dd4a40d70764
Releases: master, 6.2
Resolves: #67284
Reviewed-on: http://review.typo3.org/42547
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/core/Classes/Resource/Service/UserStorageCapabilityService.php

index b1f82b6..e4154fb 100644 (file)
@@ -40,10 +40,10 @@ class UserStorageCapabilityService {
                if ((int)$propertyArray['row']['uid'] > 0) {
                        $storage = ResourceFactory::getInstance()->getStorageObject($fileRecord['uid']);
                        $storageRecord = $storage->getStorageRecord();
-                       $isPublic = $storage->isPublic();
+                       $isPublic = $storage->isPublic() && $storageRecord['is_public'];
 
                        // Display a warning to the BE User in case settings is not inline with storage capability.
-                       if ($storageRecord['is_public'] != $storage->isPublic()) {
+                       if ($storageRecord['is_public'] && !$storage->isPublic()) {
                                $message = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\FlashMessage',
                                        $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:warning.message.storage_is_no_public'),
                                        $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:warning.header.storage_is_no_public'),