Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Fix error No repo found for user
Browse files Browse the repository at this point in the history
  • Loading branch information
c12simple committed Apr 12, 2017
1 parent 01d4133 commit 8619edb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions core/src/core/src/pydio/Core/Services/UsersService.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public static function getRepositoriesForUser($user, $includeShared = true, $det
}
$self = self::instance();
$repos = $self->getFromCaches($user->getId());
if($repos !== null) {
if(!empty($repos)) {
$userRepos = $repos;
} else{
$list = new FilteredRepositoriesList($user);
Expand Down Expand Up @@ -204,10 +204,10 @@ private function setInCache($userId, $repoList){
*/
private function getFromCaches($userId){

$fromSesssion = SessionService::getLoadedRepositories();
if($fromSesssion !== null){
$this->repositoriesCache[$userId] = $fromSesssion;
return $fromSesssion;
$fromSession = SessionService::getLoadedRepositories();
if($fromSession !== null && is_array($fromSession) && count($fromSession)){
$this->repositoriesCache[$userId] = $fromSession;
return $fromSession;
}
if(isSet($this->repositoriesCache[$userId])) {
$configsNotCorrupted = array_reduce($this->repositoriesCache[$userId], function($carry, $item){ return $carry && is_object($item) && ($item instanceof RepositoryInterface); }, true);
Expand Down

0 comments on commit 8619edb

Please sign in to comment.