Home
Documentation
Downloads
Demo
Tracker
Development
Translation
Moodle.net
Search
projects
/
moodle.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4f36324
)
MDL-28580 Administration: Added sanity check to grab wrong usage of upgrade_main_save...
author
Rajesh Taneja
<rajesh@moodle.org>
Wed, 3 Aug 2011 05:09:08 +0000
(13:09 +0800)
committer
Rajesh Taneja
<rajesh@moodle.org>
Fri, 19 Aug 2011 07:37:48 +0000
(07:37 +0000)
lib/upgradelib.php
patch
|
blob
|
blame
|
history
diff --git
a/lib/upgradelib.php
b/lib/upgradelib.php
index
f6e6c74
..
6a93f6e
100644
(file)
--- a/
lib/upgradelib.php
+++ b/
lib/upgradelib.php
@@
-114,6
+114,12
@@
class plugin_defective_exception extends moodle_exception {
function upgrade_main_savepoint($result, $version, $allowabort=true) {
global $CFG;
+ //sanity check to avoid confusion with upgrade_mod_savepoint usage.
+ if (!is_bool($allowabort)) {
+ $errormessage = 'Parameter type mismatch. Are you mixing up upgrade_main_savepoint() and upgrade_mod_savepoint()?';
+ throw new coding_exception($errormessage);
+ }
+
if (!$result) {
throw new upgrade_exception(null, $version);
}