Skip to content

Commit

Permalink
MDL-29231 - Course, Resource - Fix so that the correct icon is displa…
Browse files Browse the repository at this point in the history
…yed for courses that have had two or more files uploaded to them - Thanks Michael D for the patch
  • Loading branch information
jsnfwlr committed Oct 13, 2011
1 parent 6731a04 commit 020088d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mod/resource/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ function resource_get_coursemodule_info($coursemodule) {
$fs = get_file_storage();
$files = $fs->get_area_files($context->id, 'mod_resource', 'content', 0, 'sortorder DESC, id ASC', false); // TODO: this is not very efficient!!
if (count($files) >= 1) {
$mainfile = array_pop($files);
$mainfile = reset($files);
$info->icon = file_extension_icon($mainfile->get_filename());
$resource->mainfile = $mainfile->get_filename();
}
Expand Down

0 comments on commit 020088d

Please sign in to comment.