Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'MDL-35637_m22' of git://github.com/markn86/moodle into …

…MOODLE_22_STABLE
  • Loading branch information...
commit ab6a0f497b7f73e7cbddb93ad31c919539ffb8d3 2 parents de165ba + dde080f
@stronk7 stronk7 authored
Showing with 11 additions and 10 deletions.
  1. +11 −10 group/lib.php
View
21 group/lib.php
@@ -205,17 +205,18 @@ function groups_update_group_icon($group, $data, $editform) {
$context = get_context_instance(CONTEXT_COURSE, $group->courseid, MUST_EXIST);
//TODO: it would make sense to allow picture deleting too (skodak)
-
- if ($iconfile = $editform->save_temp_file('imagefile')) {
- if (process_new_icon($context, 'group', 'icon', $group->id, $iconfile)) {
- $DB->set_field('groups', 'picture', 1, array('id'=>$group->id));
- $group->picture = 1;
- } else {
- $fs->delete_area_files($context->id, 'group', 'icon', $group->id);
- $DB->set_field('groups', 'picture', 0, array('id'=>$group->id));
- $group->picture = 0;
+ if (!empty($CFG->gdversion)) {
+ if ($iconfile = $editform->save_temp_file('imagefile')) {
+ if (process_new_icon($context, 'group', 'icon', $group->id, $iconfile)) {
+ $DB->set_field('groups', 'picture', 1, array('id'=>$group->id));
+ $group->picture = 1;
+ } else {
+ $fs->delete_area_files($context->id, 'group', 'icon', $group->id);
+ $DB->set_field('groups', 'picture', 0, array('id'=>$group->id));
+ $group->picture = 0;
+ }
+ @unlink($iconfile);
}
- @unlink($iconfile);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.