Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'MDL-35637_master' of git://github.com/markn86/moodle

  • Loading branch information...
commit a5fc5b6cebbff3d07fff6b509a4243b70260a5c0 2 parents a499689 + 5a45b93
Eloy Lafuente (stronk7) stronk7 authored

Showing 1 changed file with 11 additions and 10 deletions. Show diff stats Hide diff stats

  1. +11 10 group/lib.php
21 group/lib.php
@@ -311,17 +311,18 @@ function groups_update_group_icon($group, $data, $editform) {
311 311 $context = context_course::instance($group->courseid, MUST_EXIST);
312 312
313 313 //TODO: it would make sense to allow picture deleting too (skodak)
314   -
315   - if ($iconfile = $editform->save_temp_file('imagefile')) {
316   - if (process_new_icon($context, 'group', 'icon', $group->id, $iconfile)) {
317   - $DB->set_field('groups', 'picture', 1, array('id'=>$group->id));
318   - $group->picture = 1;
319   - } else {
320   - $fs->delete_area_files($context->id, 'group', 'icon', $group->id);
321   - $DB->set_field('groups', 'picture', 0, array('id'=>$group->id));
322   - $group->picture = 0;
  314 + if (!empty($CFG->gdversion)) {
  315 + if ($iconfile = $editform->save_temp_file('imagefile')) {
  316 + if (process_new_icon($context, 'group', 'icon', $group->id, $iconfile)) {
  317 + $DB->set_field('groups', 'picture', 1, array('id'=>$group->id));
  318 + $group->picture = 1;
  319 + } else {
  320 + $fs->delete_area_files($context->id, 'group', 'icon', $group->id);
  321 + $DB->set_field('groups', 'picture', 0, array('id'=>$group->id));
  322 + $group->picture = 0;
  323 + }
  324 + @unlink($iconfile);
323 325 }
324   - @unlink($iconfile);
325 326 }
326 327 }
327 328

0 comments on commit a5fc5b6

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