Skip to content
Snippets Groups Projects
Commit 0e111e1a authored by Robin Appelman's avatar Robin Appelman
Browse files

fix increasing folder sizes in filecache for custom roots

parent 57ed83f2
No related branches found
No related tags found
No related merge requests found
...@@ -126,7 +126,7 @@ class OC_FileCache{ ...@@ -126,7 +126,7 @@ class OC_FileCache{
$query=OC_DB::prepare($sql); $query=OC_DB::prepare($sql);
$result=$query->execute($arguments); $result=$query->execute($arguments);
if(OC_DB::isError($result)){ if(OC_DB::isError($result)){
OC_Log::write('files','error while updating file('.$path.') in cache',OC_Log::ERROR); OC_Log::write('files','error while updating file('.$id.') in cache',OC_Log::ERROR);
} }
} }
...@@ -303,7 +303,7 @@ class OC_FileCache{ ...@@ -303,7 +303,7 @@ class OC_FileCache{
*/ */
public static function increaseSize($path,$sizeDiff, $root=false){ public static function increaseSize($path,$sizeDiff, $root=false){
if($sizeDiff==0) return; if($sizeDiff==0) return;
$id=self::getId($path,''); $id=self::getId($path,$root);
while($id!=-1){//walk up the filetree increasing the size of all parent folders while($id!=-1){//walk up the filetree increasing the size of all parent folders
$query=OC_DB::prepare('UPDATE *PREFIX*fscache SET size=size+? WHERE id=?'); $query=OC_DB::prepare('UPDATE *PREFIX*fscache SET size=size+? WHERE id=?');
$query->execute(array($sizeDiff,$id)); $query->execute(array($sizeDiff,$id));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment