Skip to content
Browse files

Fix error when awarding a badge from recipients page

  • Loading branch information...
1 parent 422f68f commit 04da1a5ac2c62c561b55aeb8175b3bca132ca7a4 @ybozhko ybozhko committed Apr 10, 2013
Showing with 3 additions and 2 deletions.
  1. +2 −1 badges/award.php
  2. +1 −1 badges/renderer.php
View
3 badges/award.php
@@ -93,7 +93,8 @@
}
} else {
// Current user's role.
- $issuerrole = array_shift(get_user_roles($context, $USER->id));
+ $roles = get_user_roles($context, $USER->id);
+ $issuerrole = array_shift($roles);
if (!isset($issuerrole->roleid) || !in_array($issuerrole->roleid, $accepted_roles)) {
echo $OUTPUT->header();
$rlink = html_writer::link(new moodle_url('recipients.php', array('id' => $badge->id)), get_string('recipients', 'badges'));
View
2 badges/renderer.php
@@ -97,7 +97,7 @@ public function recipients_selection_form(user_selector_base $existinguc, user_s
$output = '';
$formattributes = array();
$formattributes['id'] = 'recipientform';
- $formattributes['action'] = '';
+ $formattributes['action'] = $this->page->url;
$formattributes['method'] = 'post';
$output .= html_writer::start_tag('form', $formattributes);
$output .= html_writer::empty_tag('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey()));

0 comments on commit 04da1a5

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