[BUGFIX] Capability check fails for some storage types 27/39927/5
authorAndreas Wolf <dev@a-w.io>
Wed, 3 Jun 2015 14:57:32 +0000 (16:57 +0200)
committerBenni Mack <benni@typo3.org>
Wed, 12 Aug 2015 19:33:19 +0000 (21:33 +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/39927
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/core/Classes/Resource/Service/UserStorageCapabilityService.php

index 28696f1..fadb19b 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::class,
                                        $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'),