From 4085be6e8c521ed2d3d614baa391821583b5d6ab Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 5 Nov 2009 14:05:18 +0000 Subject: [PATCH] Fix for 'Cache not found but ext-cache is active' --- inc/extensions-functions.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/inc/extensions-functions.php b/inc/extensions-functions.php index f531cb40e8..5bcdf37ee2 100644 --- a/inc/extensions-functions.php +++ b/inc/extensions-functions.php @@ -765,17 +765,18 @@ function getExtensionName ($ext_id) { } // Get extension id from name -function getExtensionId ($ext_name, $forceDb = false) { +function getExtensionId ($ext_name) { // Init id number $ret = 0; + // Do we have cache? if (isset($GLOBALS['cache_array']['extension']['ext_id'][$ext_name])) { // Load from cache $ret = $GLOBALS['cache_array']['extension']['ext_id'][$ext_name]; // Count cache hits incrementStatsEntry('cache_hits'); - } elseif (($forceDb === true) || (!isExtensionActive('cache'))) { + } else { // Load from database $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `ext_name`='%s' LIMIT 1", array($ext_name), __FUNCTION__, __LINE__); @@ -791,10 +792,7 @@ function getExtensionId ($ext_name, $forceDb = false) { // Cache it $GLOBALS['cache_array']['extension']['ext_id'][$ext_name] = $ret; - } else { - // Caching enabled but no cache found is bad - debug_report_bug(__FUNCTION__ . ': Cache not found but ext-cache is active. ext_name=' . $ext_name); - } // END - if + } // Return value return $ret; -- 2.30.2