Permalink
Browse files

Merge branch 'wip-MDL-29231-stable20' of git://github.com/phalacee/mo…

…odle into MOODLE_20_STABLE
  • Loading branch information...
Sam Hemelryk
Sam Hemelryk committed Oct 25, 2011
2 parents 7a03cfd + 647153c commit 88507c00633d12005449dd0f846d4032713a9dd8
Showing with 1 addition and 1 deletion.
  1. +1 −1 mod/resource/lib.php
View
@@ -249,7 +249,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 88507c0

Please sign in to comment.