MDL-45312 qtype_missingtype or qbehaviour_missing cannot be uninstalled.
authorTim Hunt <T.J.Hunt@open.ac.uk>
Mon, 28 Apr 2014 20:25:51 +0000 (21:25 +0100)
committerTim Hunt <T.J.Hunt@open.ac.uk>
Mon, 28 Apr 2014 20:45:46 +0000 (21:45 +0100)
They are required by the system.

lib/classes/plugininfo/qbehaviour.php
lib/classes/plugininfo/qtype.php

index b33e226..85de134 100644 (file)
@@ -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));
     }
 
index 375ee1a..deeae71 100644 (file)
@@ -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));
     }