mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
MDL-45312 qtype_missingtype or qbehaviour_missing cannot be uninstalled.
They are required by the system.
This commit is contained in:
parent
83ddacfff7
commit
856c2f1404
2 changed files with 10 additions and 0 deletions
|
@ -60,6 +60,11 @@ class qbehaviour extends base {
|
|||
public function is_uninstall_allowed() {
|
||||
global $DB;
|
||||
|
||||
if ($this->name === 'missing') {
|
||||
// qbehaviour_missing is used by the system. It cannot be uninstalled.
|
||||
return false;
|
||||
}
|
||||
|
||||
return !$DB->record_exists('question_attempts', array('behaviour' => $this->name));
|
||||
}
|
||||
|
||||
|
|
|
@ -68,6 +68,11 @@ class qtype extends base {
|
|||
public function is_uninstall_allowed() {
|
||||
global $DB;
|
||||
|
||||
if ($this->name === 'missingtype') {
|
||||
// qtype_missingtype is used by the system. It cannot be uninstalled.
|
||||
return false;
|
||||
}
|
||||
|
||||
return !$DB->record_exists('question', array('qtype' => $this->name));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue