From: Roland Häder Date: Tue, 9 Aug 2011 17:35:33 +0000 (+0000) Subject: Added check if cache is valid, points_data is only available with recent ext-sql_patc... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=75c607f5f29956eb71599aee3f682753e4d21fef;p=mailer.git Added check if cache is valid, points_data is only available with recent ext-sql_patches, thanks to yester for reporting this --- diff --git a/inc/loader/load-modules.php b/inc/loader/load-modules.php index e9ae70acdf..7278445196 100644 --- a/inc/loader/load-modules.php +++ b/inc/loader/load-modules.php @@ -53,8 +53,11 @@ if (($GLOBALS['cache_instance']->loadCacheFile('modules')) && ($GLOBALS['cache_i // Do only process valid arrays if (!isset($modArray['module'])) { - // We should fix this! - debug_report_bug(__FILE__, __LINE__, 'modArray=
'.print_r($modArray, true).'
'); + // Try to remove the cache file + $GLOBALS['cache_instance']->removeCacheFile(); + + // We should fix this + debug_report_bug(__FILE__, __LINE__, 'modArray=
' . print_r($modArray, true) . '
Please try to reload to fix this.'); } // END - if // Rewrite some parts diff --git a/inc/loader/load-points_data.php b/inc/loader/load-points_data.php index 744b616ba7..659b3fed1c 100644 --- a/inc/loader/load-points_data.php +++ b/inc/loader/load-points_data.php @@ -48,6 +48,15 @@ if (($GLOBALS['cache_instance']->loadCacheFile('points_data')) && ($GLOBALS['cac // Load cache $GLOBALS['cache_array']['points_data'] = $GLOBALS['cache_instance']->getArrayFromCache(); + // Do we have cache? + if (!isset($GLOBALS['cache_array']['points_data']['subject'])) { + // Try to remove the cache file + $GLOBALS['cache_instance']->removeCacheFile(); + + // Not found, so better abort here + debug_report_bug(__FILE__, __LINE__, 'points_data has been generated, but does not contain "subject". Please try to reload to fix this.'); + } // END - if + // Init temporary array $pointsData = array(); @@ -66,7 +75,7 @@ if (($GLOBALS['cache_instance']->loadCacheFile('points_data')) && ($GLOBALS['cac // Set the array back and remove temporary $GLOBALS['cache_array']['points_data'] = $pointsData; unset($pointsData); -} elseif (isHtmlOutputMode()) { +} elseif ((isHtmlOutputMode()) && (isExtensionInstalledAndNewer('sql_patches', '0.8.0'))) { // Create cache file $GLOBALS['cache_instance']->init();