mirror of
https://github.com/moodle/moodle.git
synced 2025-02-15 05:15:07 +01:00
Merge branch 'MDL-77086-master' of https://github.com/sarjona/moodle
This commit is contained in:
commit
9074c28699
@ -228,8 +228,19 @@ class backpack_api2p1 {
|
||||
$msg['status'] = \core\output\notification::NOTIFY_SUCCESS;
|
||||
$msg['message'] = get_string('addedtobackpack', 'badges');
|
||||
} else {
|
||||
$statuserror = $response->status->error;
|
||||
if (is_array($statuserror)) {
|
||||
// Although the specification defines that status error is a string, some providers, like Badgr, are wrongly
|
||||
// returning an array. It has been reported, but adding this extra check doesn't hurt, just in case.
|
||||
$statuserror = implode($statuserror);
|
||||
}
|
||||
$data = [
|
||||
'badgename' => $data['assertion']['badge']['name'],
|
||||
'error' => $statuserror,
|
||||
];
|
||||
|
||||
$msg['status'] = \core\output\notification::NOTIFY_ERROR;
|
||||
$msg['message'] = get_string('backpackexporterror', 'badges', $data['assertion']['badge']['name']);
|
||||
$msg['message'] = get_string('backpackexporterrorwithinfo', 'badges', $data);
|
||||
}
|
||||
return $msg;
|
||||
}
|
||||
|
@ -129,6 +129,7 @@ $string['backpackemailverifypending'] = 'A verification email has been sent to <
|
||||
$string['backpackemailverifysuccess'] = 'Thanks for verifying your email address. You are now connected to your backpack.';
|
||||
$string['backpackemailverifytokenmismatch'] = 'The token in the link you clicked does not match the stored token. Make sure you clicked the link in most recent email you received.';
|
||||
$string['backpackexporterror'] = 'Can\'t export the badge to backpack';
|
||||
$string['backpackexporterrorwithinfo'] = 'Can\'t export the badge "{$a->badgename}" to backpack. Error: {$a->error}';
|
||||
$string['backpackimport'] = 'Badge import settings';
|
||||
$string['backpackimport_help'] = 'After the backpack connection is successfully established, badges from your backpack can be displayed on your badges page and your profile page.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user