Permalink
Browse files

MDL-28580 Administration: Added sanity check to grab wrong usage of u…

…pgrade_main_savepoint
  • Loading branch information...
Rajesh Taneja
Rajesh Taneja committed Aug 3, 2011
1 parent 4f36324 commit bb44ef990f4ec9e57c03709069ea0045f50526ed
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/upgradelib.php
View
@@ -114,6 +114,12 @@ function __construct($plugin, $details) {
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);
}

0 comments on commit bb44ef9

Please sign in to comment.