Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/files_sharing/lib/sharedstorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ private function init() {
}

private function isValid() {
$this->init();
return ($this->sourceRootInfo->getPermissions() & Constants::PERMISSION_SHARE) === Constants::PERMISSION_SHARE;
}

Expand Down Expand Up @@ -566,6 +567,7 @@ public function hasUpdated($path, $time) {
}

public function getCache($path = '', $storage = null) {
$this->init();
if (!$storage) {
$storage = $this;
}
Expand Down
9 changes: 7 additions & 2 deletions lib/private/files/config/usermountcache.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
use OC\Files\Filesystem;
use OCA\Files_Sharing\SharedMount;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\Files\Config\ICachedMountInfo;
use OCP\Files\Config\IUserMountCache;
Expand Down Expand Up @@ -75,12 +76,16 @@ public function __construct(IDBConnection $connection, IUserManager $userManager
public function registerMounts(IUser $user, array $mounts) {
// filter out non-proper storages coming from unit tests
$mounts = array_filter($mounts, function (IMountPoint $mount) {
return $mount->getStorage() && $mount->getStorage()->getCache();
return $mount instanceof SharedMount || $mount->getStorage() && $mount->getStorage()->getCache();
});
/** @var ICachedMountInfo[] $newMounts */
$newMounts = array_map(function (IMountPoint $mount) use ($user) {
$storage = $mount->getStorage();
$rootId = (int)$storage->getCache()->getId('');
if ($storage->instanceOfStorage('\OC\Files\Storage\Shared')) {
$rootId = (int)$storage->getShare()['file_source'];
} else {
$rootId = (int)$storage->getCache()->getId('');
}
$storageId = (int)$storage->getStorageCache()->getNumericId();
// filter out any storages which aren't scanned yet since we aren't interested in files from those storages (yet)
if ($rootId === -1) {
Expand Down
2 changes: 1 addition & 1 deletion lib/private/util.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public static function setupFS($user = '') {

// install storage availability wrapper, before most other wrappers
\OC\Files\Filesystem::addStorageWrapper('oc_availability', function ($mountPoint, $storage) {
if (!$storage->isLocal()) {
if (!$storage->instanceOfStorage('\OC\Files\Storage\Shared') && !$storage->isLocal()) {
return new \OC\Files\Storage\Wrapper\Availability(['storage' => $storage]);
}
return $storage;
Expand Down