Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…odle into MOODLE_21_STABLE
  • Loading branch information...
commit 523f4aa78747ee238bd8ac93988440200e00c9cd 2 parents b304495 + e2236ba
@samhemelryk samhemelryk authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  mod/resource/lib.php
View
2  mod/resource/lib.php
@@ -251,7 +251,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();
}
Please sign in to comment.
Something went wrong with that request. Please try again.