From d9ba4bd6ad97905e2f2db2c03c4f29ca34e96175 Mon Sep 17 00:00:00 2001
From: David Mudrak <david.mudrak@gmail.com>
Date: Tue, 12 Oct 2010 14:56:01 +0000
Subject: [PATCH] MDL-24636 File API: Fixed calculation of the number of
 current files when merging with the draft area

---
 lib/filelib.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/filelib.php b/lib/filelib.php
index 18637a0aa82..7c4c8dec05e 100644
--- a/lib/filelib.php
+++ b/lib/filelib.php
@@ -677,7 +677,7 @@ function file_save_draft_area_files($draftitemid, $contextid, $component, $filea
             }
             // unchanged file or directory - we keep it as is
             unset($newhashes[$oldhash]);
-            if (!$file->is_directory()) {
+            if (!$oldfile->is_directory()) {
                 $filecount++;
             }
         }