Skip to content

Commit

Permalink
Fix error when awarding a badge from recipients page
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuliya Bozhko committed Apr 9, 2013
1 parent 422f68f commit 04da1a5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion badges/award.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
2 changes: 1 addition & 1 deletion badges/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down

0 comments on commit 04da1a5

Please sign in to comment.