diff --git a/core/util.inc.php b/core/util.inc.php index de188bfc..a7bfc8ce 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -600,7 +600,7 @@ $_execs = 0; */ function _count_execs($db, $sql, $inputarray) { global $_execs; - if (defined(DEBUG_SQL) && (DEBUG_SQL === true || (is_null(DEBUG_SQL) && @$_GET['DEBUG_SQL']))) { + if ((defined(DEBUG_SQL) && DEBUG_SQL === true) || (!defined(DEBUG_SQL) && @$_GET['DEBUG_SQL'])) { $fp = @fopen("data/sql.log", "a"); if($fp) { if(isset($inputarray) && is_array($inputarray)) { diff --git a/tests/test_all.php b/tests/test_all.php index c4779848..d45112c0 100644 --- a/tests/test_all.php +++ b/tests/test_all.php @@ -54,7 +54,12 @@ foreach(_get_themelet_files(get_theme()) as $themelet) { _load_extensions(); -// Put the database into autocommit mode. (We don't really need transactions for the test setup) +// Fire off the InitExtEvent() +$page = class_exists("CustomPage") ? new CustomPage() : new Page(); +$user = _get_user(); +send_event(new InitExtEvent()); + +// Put the database into autocommit mode for making the users. $database->commit(); // Create the necessary users for the tests. @@ -62,7 +67,7 @@ $userPage = new UserPage(); $userPage->onUserCreation(new UserCreationEvent("demo", "demo", "")); $userPage->onUserCreation(new UserCreationEvent("test", "test", "")); -// Fire off the InitExtEvent() +// Fire off the InitExtEvent() again after we have made the users. $page = class_exists("CustomPage") ? new CustomPage() : new Page(); $user = _get_user(); send_event(new InitExtEvent());