diff --git a/better_statistics.module b/better_statistics.module index c4eb989..2a5d83e 100644 --- a/better_statistics.module +++ b/better_statistics.module @@ -101,6 +101,7 @@ function better_statistics_ctools_plugin_api_hook_name() { return 'statistics_api'; } + /** * Implements hook_boot(). * @@ -120,8 +121,9 @@ function better_statistics_boot() { // Is Drupal page caching enabled. $drupal_cache_enabled = variable_get('cache'); - // Is Better Statistics enabled to track cached pages. - $bs_cache_logging = variable_get('statistics_access_log_restrictions_cache', TRUE); + // Is Better Statistics enabled to track cache status. + $active_fields = variable_get('better_statistics_fields', better_statistics_get_default_fields()); + $bs_cache_logging = isset($active_fields['cache']); // Set a cookie with cache status retrieved from the headers. if ($drupal_cache_enabled && $bs_cache_logging) { @@ -138,6 +140,7 @@ function better_statistics_boot() { } } + /** * Implements hook_exit(). * diff --git a/js/fields/custom.js b/js/fields/custom.js index f2a4bb0..993d5c1 100644 --- a/js/fields/custom.js +++ b/js/fields/custom.js @@ -14,7 +14,7 @@ document.addEventListener('statistics.accesslog', function(event) { // Cache Status. var cacheStatus = getCookie('Drupal.cache.status'); if (cacheStatus == 'void' || cacheStatus == null) { - event.data.cache = ''; + event.data.cache = 'NULL'; } else { event.data.cache = cacheStatus;