From e6057c656fa4962bfcff45684c9e1a7a7ff2ea48 Mon Sep 17 00:00:00 2001 From: jgen Date: Sat, 22 Feb 2014 01:22:14 -0500 Subject: [PATCH] Re-order the events to ensure InitExtEvent() is fired off both with and without users. --- core/util.inc.php | 2 +- tests/test_all.php | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) 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());