Skip to content

Commit

Permalink
MDL-54879 mod_lti: Add fallback options for error message upon failure
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed Jul 28, 2016
1 parent d1a3ea6 commit 653b8ef
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mod/lti/externalregistrationreturn.php
Expand Up @@ -45,6 +45,17 @@
$output = $PAGE->get_renderer('mod_lti');
echo $output->header();

// Check status and lti_errormsg.
if ($status !== 'success' && empty($err)) {
// We have a failed status and an empty lti_errormsg. Check if we can use lti_msg.
if (!empty($msg)) {
// The lti_msg attribute is set, use this as the error message.
$err = $msg;
} else {
// Otherwise, use our generic error message.
$err = get_string('failedtocreatetooltype', 'mod_lti');
}
}
$params = array('message' => s($msg), 'error' => s($err), 'id' => $id, 'status' => s($status));

$page = new \mod_lti\output\external_registration_return_page();
Expand Down

0 comments on commit 653b8ef

Please sign in to comment.