Skip to content
Browse files

Merge branch 'wip-MDL-29231-master' of git://github.com/phalacee/moodle

  • Loading branch information...
2 parents 6327bf8 + 020088d commit d040ea889319a657a5ffb9eac38ea957dfa9400c Sam Hemelryk committed Oct 25, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 mod/resource/lib.php
View
2 mod/resource/lib.php
@@ -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();
}

0 comments on commit d040ea8

Please sign in to comment.
Something went wrong with that request. Please try again.