]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-13863 detect missing idnumbers in formulas after restore; merged from MOODLE_19_S...
authorskodak <skodak>
Mon, 10 Mar 2008 09:35:42 +0000 (09:35 +0000)
committerskodak <skodak>
Mon, 10 Mar 2008 09:35:42 +0000 (09:35 +0000)
lib/grade/grade_item.php

index 17bcada4dde97ae5afbdae6a0800042a227c7c08..0eb79ec9158bee12c5a219139d4d4193551a4580 100644 (file)
@@ -1589,6 +1589,10 @@ class grade_item extends grade_object {
 
         // prepare formula and init maths library
         $formula = preg_replace('/##(gi\d+)##/', '\1', $this->calculation);
+        if (strpos($formula, '[[') !== false) {
+            // missing item
+            return false;
+        }
         $this->formula = new calc_formula($formula);
 
         // where to look for final grades?