-
Bug
-
Resolution: Fixed
-
Major
-
2.6.5, 2.7.2, 2.7.7, 2.8.5, 2.9
-
MOODLE_26_STABLE, MOODLE_27_STABLE, MOODLE_28_STABLE, MOODLE_29_STABLE
-
MOODLE_27_STABLE, MOODLE_28_STABLE
-
wip-
MDL-47729-master -
Discovered while testing MDL-44548
repository_filesystem was designed to either always import file content (what we do for images) or never (what we do for non images). Explicit calling of import_file_contents() in random moments breaks it.
We made a fix already, need to test it and check other repositories if they can be affected by the same thing. Not doing it on Friday afternoon
diff --git a/repository/filesystem/lib.php b/repository/filesystem/lib.php
|
index 039616b..0a32a49 100644
|
--- a/repository/filesystem/lib.php
|
+++ b/repository/filesystem/lib.php
|
@@ -366,7 +366,10 @@ class repository_filesystem extends repository {
|
}
|
} else {
|
// Update only file size so file will NOT be copied into moodle filepool.
|
- $contenthash = null;
|
+ $contenthash = sha1_file($filepath);
|
+ if ($contenthash !== $file->get_contenthash()) {
|
+ $contenthash = sha1('');
|
+ }
|
$filesize = filesize($filepath);
|
}
|
$issyncing = false;
|
- blocks
-
MDL-44548 SCORM Repository Auto Update Non-functional
- Closed
- Discovered while testing
-
MDL-44548 SCORM Repository Auto Update Non-functional
- Closed
- is duplicated by
-
MDL-49621 sync_reference function for file system repositories isn't working as it should
- Closed
- Testing discovered
-
MDL-49492 Allow reporsitories to re-sync after import_file_contents
- Closed