From 739139fb13eae88204e355202bffe20ee5fc7d40 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 14 Feb 2010 23:40:52 +0000 Subject: [PATCH] Possible fix for 'errno=8,errstr=Undefined offset: 13,errfile=load_cache-modules.php,errline=66' and brothers --- inc/loader/load_cache-modules.php | 30 ++++++++++++++---------------- inc/wrapper-functions.php | 1 + 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/inc/loader/load_cache-modules.php b/inc/loader/load_cache-modules.php index 9058039183..052d9937dd 100644 --- a/inc/loader/load_cache-modules.php +++ b/inc/loader/load_cache-modules.php @@ -53,22 +53,20 @@ if (($GLOBALS['cache_instance']->loadCacheFile('modules')) && ($GLOBALS['cache_i // Rewrite module cache $modArray = $GLOBALS['cache_array']['modules']; foreach ($modArray['module'] as $key => $mod) { - $GLOBALS['cache_array']['modules']['id'][$mod] = $modArray['id'][$key]; - unset($GLOBALS['cache_array']['modules']['id'][$key]); - $GLOBALS['cache_array']['modules']['title'][$mod] = $modArray['title'][$key]; - unset($GLOBALS['cache_array']['modules']['title'][$key]); - $GLOBALS['cache_array']['modules']['locked'][$mod] = $modArray['locked'][$key]; - unset($GLOBALS['cache_array']['modules']['locked'][$key]); - $GLOBALS['cache_array']['modules']['hidden'][$mod] = $modArray['hidden'][$key]; - unset($GLOBALS['cache_array']['modules']['hidden'][$key]); - $GLOBALS['cache_array']['modules']['admin_only'][$mod] = $modArray['admin_only'][$key]; - unset($GLOBALS['cache_array']['modules']['admin_only'][$key]); - $GLOBALS['cache_array']['modules']['mem_only'][$mod] = $modArray['mem_only'][$key]; - unset($GLOBALS['cache_array']['modules']['mem_only'][$key]); - if (isset($GLOBALS['cache_array']['modules']['has_menu'][$key])) { - $GLOBALS['cache_array']['modules']['has_menu'][$mod] = $modArray['has_menu'][$key]; - unset($GLOBALS['cache_array']['modules']['has_menu'][$key]); - } // END - if + // Add all + foreach (array('id','title','locked','hidden','admin_only','mem_only','has_menu') as $entry) { + // Is the entry set? + if (isset($GLOBALS['cache_array']['modules'][$entry][$key])) { + // Transfer it + $GLOBALS['cache_array']['modules'][$entry][$mod] = $modArray[$entry][$key]; + + // And delete cache + unset($GLOBALS['cache_array']['modules'][$entry][$key]); + } else { + // Log this for debug purposes + debugLogMessage('[' . basename(__FILE__) . ':' . __LINE__ . '] Entry not found. module=' . $mod . ',key=' . $key . ',entry=' . $entry); + } + } // END - foreach } // END - foreach unset($modArray); } elseif (getOutputMode() != 1) { diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index 9de0106688..6cbb71e3b8 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -402,6 +402,7 @@ function copyFileVerified ($source, $dest, $chmod = '') { // Send a header but checks before if we can do so function sendHeader ($header) { // Send the header + //* DEBUG: */ logDebugMessage(__FUNCTION__ . ': header=' . $header); $GLOBALS['header'][] = trim($header); } -- 2.39.5