Skip to content

Commit

Permalink
Merge pull request #612 from guillogo/MOODLE_310_STABLE_issue609
Browse files Browse the repository at this point in the history
Issue #609: When a file size is 0 bytes do not mark it as location error
  • Loading branch information
petersistrom authored Sep 2, 2024
2 parents 4e04360 + 15e7544 commit 6388430
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion classes/local/store/object_file_system.php
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ public function readfile(\stored_file $file) {

$this->logger->log_object_read('readfile', $path, $file->get_filesize());

if (!$success) {
if ($success === false) {
manager::update_object_by_hash($file->get_contenthash(), OBJECT_LOCATION_ERROR);
}
}
Expand Down
2 changes: 1 addition & 1 deletion classes/local/store/s3/file_system.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function readfile(\stored_file $file) {
$this->get_logger()->end_timing();
$this->get_logger()->log_object_read('readfile', $path, $file->get_filesize());

if (!$success) {
if ($success === false) {
manager::update_object_by_hash($file->get_contenthash(), OBJECT_LOCATION_ERROR);
throw new \file_exception('storedfilecannotreadfile', $file->get_filename());
}
Expand Down

0 comments on commit 6388430

Please sign in to comment.