mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-76258 mod_lti: Reset clientid after restore
This commit is contained in:
parent
57c1e97bf1
commit
b8a0ac4808
@ -48,6 +48,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
use mod_lti\local\ltiopenid\registration_helper;
|
||||
/**
|
||||
* Structure step to restore one lti activity
|
||||
*/
|
||||
@ -134,6 +135,9 @@ class restore_lti_activity_structure_step extends restore_activity_structure_ste
|
||||
$this->newltitype = false;
|
||||
if (!$ltitypeid && $data->course == $courseid) {
|
||||
unset($data->toolproxyid); // Course tools can not use LTI2.
|
||||
if (!empty($data->clientid)) {
|
||||
$data->clientid = registration_helper::get()->new_clientid(); // Need to rebuild clientid to ensure uniqueness.
|
||||
}
|
||||
$ltitypeid = $DB->insert_record('lti_types', $data);
|
||||
$this->newltitype = true;
|
||||
$this->set_mapping('ltitype', $oldid, $ltitypeid);
|
||||
|
Loading…
x
Reference in New Issue
Block a user