Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

…pgrade_main_savepoint
  • Loading branch information...
commit 01f9bc7948aab7ba59cd67a89c82c655d499172a 1 parent 24654d9
Rajesh Taneja authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/upgradelib.php
View
6 lib/upgradelib.php
@@ -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);
}
Please sign in to comment.
Something went wrong with that request. Please try again.