mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 20:53:53 +01:00
MDL-36580 backup: Avoid PHP notice restoring old backups
Before this implementation, both resourcekey and password were not being included in the backups, so old backups are missing them. To keep upwards compatibility and avoid a PHP Notice (undefined property), existence is checked via isset(), that is the usual way all over the restore process.
This commit is contained in:
parent
059079e945
commit
984470d8a1
@ -89,8 +89,8 @@ class restore_lti_activity_structure_step extends restore_activity_structure_ste
|
||||
|
||||
// Try to decrypt resourcekey and password. Null if not possible (DB default).
|
||||
// Note these fields were originally encrypted on backup using {link @encrypted_final_element}.
|
||||
$data->resourcekey = $this->decrypt($data->resourcekey);
|
||||
$data->password = $this->decrypt($data->password);
|
||||
$data->resourcekey = isset($data->resourcekey) ? $this->decrypt($data->resourcekey) : null;
|
||||
$data->password = isset($data->password) ? $this->decrypt($data->password) : null;
|
||||
|
||||
$newitemid = $DB->insert_record('lti', $data);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user