From ffca6c2202f89249d3bc50b5645b94c772ff3b0d Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Sat, 5 Dec 2009 15:31:44 +0000 Subject: fixed bug where active record override wasn't being honored properly --- system/database/DB.php | 6 +++--- system/libraries/Loader.php | 2 +- user_guide/changelog.html | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/system/database/DB.php b/system/database/DB.php index 0f734d748..0451c18e6 100644 --- a/system/database/DB.php +++ b/system/database/DB.php @@ -22,7 +22,7 @@ * @author ExpressionEngine Dev Team * @link http://codeigniter.com/user_guide/database/ */ -function &DB($params = '', $active_record_override = FALSE) +function &DB($params = '', $active_record_override = NULL) { // Load the DB config file if a DSN string wasn't passed if (is_string($params) AND strpos($params, '://') === FALSE) @@ -102,9 +102,9 @@ function &DB($params = '', $active_record_override = FALSE) // based on whether we're using the active record class or not. // Kudos to Paul for discovering this clever use of eval() - if ($active_record_override == TRUE) + if ($active_record_override !== NULL) { - $active_record = TRUE; + $active_record = $active_record_override; } require_once(BASEPATH.'database/DB_driver'.EXT); diff --git a/system/libraries/Loader.php b/system/libraries/Loader.php index 781c83c65..710c5c148 100644 --- a/system/libraries/Loader.php +++ b/system/libraries/Loader.php @@ -198,7 +198,7 @@ class CI_Loader { * @param bool whether to enable active record (this allows us to override the config setting) * @return object */ - function database($params = '', $return = FALSE, $active_record = FALSE) + function database($params = '', $return = FALSE, $active_record = NULL) { // Grab the super object $CI =& get_instance(); diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 22a54a25d..116aaa64d 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -87,6 +87,7 @@ SVN Revision:

  • Modified inflector helper to properly pluralize words that end in 'ch' or 'sh'
  • Fixed a bug in xss_clean() that was not allowing hyphens in query strings of submitted URLs.
  • Fixed bugs in get_dir_file_info() and get_file_info() in the File Helper with recursion, and file paths on Windows.
  • +
  • Fixed a bug where Active Record override parameter would not let you disable Active Record if it was enabled in your database config file.
  • Version 1.7.2

    -- cgit v1.2.3-24-g4f1b