diff --git a/advagg.cache.inc b/advagg.cache.inc index 1be81db..06c5877 100644 --- a/advagg.cache.inc +++ b/advagg.cache.inc @@ -27,12 +27,6 @@ function advagg_scan_for_changes() { // Get filesystem data. $info = advagg_get_info_on_file($row['filename'], TRUE); - // Make sure file exists. - if (empty($info['content_hash'])) { - $files_that_have_changed[$row['filename']] = $info; - continue; - } - // Select the keys to compare. $keys_to_compare = array( 'filesize', diff --git a/advagg.inc b/advagg.inc index 05e5ee1..033fda8 100644 --- a/advagg.inc +++ b/advagg.inc @@ -338,8 +338,15 @@ function advagg_get_info_on_file($filename, $bypass_cache = FALSE) { // Remove file in the cache if it does not exist. if (!file_exists($filename)) { cache_clear_all($cache_id, 'cache_advagg_info', FALSE); - // Only return filename hash. - return array('filename_hash' => $filename_hash); + // Return filename_hash & data. Empty values for the other keys. + return array( + 'filesize' => 0, + 'mtime' => 0, + 'filename_hash' => $filename_hash, + 'content_hash' => '', + 'linecount' => 0, + 'data' => $filename, + ); } // Get the file contents diff --git a/advagg_js_compress/advagg_js_compress.advagg.inc b/advagg_js_compress/advagg_js_compress.advagg.inc index 6e3ec14..be9ccb4 100644 --- a/advagg_js_compress/advagg_js_compress.advagg.inc +++ b/advagg_js_compress/advagg_js_compress.advagg.inc @@ -155,7 +155,7 @@ function advagg_js_compress_prep(&$contents, $filename, $aggregate_settings, $ad // Try cache. $info = advagg_get_info_on_file($filename); $cache_id = 'advagg:js_compress:' . $compressor . ':' . $info['filename_hash']; - $cache_id .= isset($info['content_hash']) ? ':' . $info['content_hash'] : ''; + $cache_id .= !empty($info['content_hash']) ? ':' . $info['content_hash'] : ''; $cache = cache_get($cache_id, 'cache_advagg_info'); if (!empty($cache->data)) { $contents = $cache->data;