mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
Merge branch 'MDL-79862-master' of https://github.com/aanabit/moodle
This commit is contained in:
commit
51a70cf44e
@ -129,7 +129,15 @@ class core_completion_defaultedit_form extends core_completion_edit_base_form {
|
||||
$this->get_suffix()
|
||||
);
|
||||
$data = (array)$data;
|
||||
$modform->data_preprocessing($data);
|
||||
try {
|
||||
$modform->data_preprocessing($data);
|
||||
} catch (moodle_exception $e) {
|
||||
debugging(
|
||||
'data_preprocessing function of module ' . $modnames[0] .
|
||||
' should be fixed so it can be shown together with other Default activity completion forms',
|
||||
DEBUG_DEVELOPER
|
||||
);
|
||||
}
|
||||
// Unset fields that will conflict with this form and set data to this form.
|
||||
unset($data['cmid']);
|
||||
unset($data['modids']);
|
||||
|
@ -125,7 +125,9 @@ abstract class core_completion_edit_base_form extends moodleform {
|
||||
' has wrong suffix and has been removed from the form. This has to be fixed by the developer',
|
||||
DEBUG_DEVELOPER
|
||||
);
|
||||
$moduleform->_form->removeElement($customcompletionelement);
|
||||
if ($moduleform->_form->elementExists($customcompletionelement)) {
|
||||
$moduleform->_form->removeElement($customcompletionelement);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user