fix increasing folder sizes in filecache for custom roots

This commit is contained in:
Robin Appelman 2012-07-20 16:56:07 +02:00
parent 57ed83f266
commit 0e111e1a17
1 changed files with 2 additions and 2 deletions

View File

@ -126,7 +126,7 @@ class OC_FileCache{
$query=OC_DB::prepare($sql);
$result=$query->execute($arguments);
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{
*/
public static function increaseSize($path,$sizeDiff, $root=false){
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
$query=OC_DB::prepare('UPDATE *PREFIX*fscache SET size=size+? WHERE id=?');
$query->execute(array($sizeDiff,$id));