Commit 31278181 authored by wodenx's avatar wodenx Committed by Spleshka

Issue #2156421 by wodenx, Spleshka: Invoke hook_cache_expire_alter() even if a...

Issue #2156421 by wodenx, Spleshka: Invoke hook_cache_expire_alter() even if a controller does not specify any urls.
parent 21b28e07
......@@ -27,6 +27,11 @@ class ExpireAPI {
// Allow other modules to modify the list prior to expiring.
drupal_alter('expire_cache', $urls, $object_type, $object, $absolute_urls_passed);
// Nothing to expire, so exit.
if (empty($urls)) {
return;
}
// If was passed array with absolute URLs we should not do any job here.
if ($absolute_urls_passed) {
$wildcards = array();
......
......@@ -99,9 +99,7 @@ class ExpireComment implements ExpireInterface {
}
// Flush page cache for expired urls.
if (!empty($expire_urls)) {
ExpireAPI::executeExpiration($expire_urls, 'comment', $comment);
}
ExpireAPI::executeExpiration($expire_urls, 'comment', $comment);
$cache_flushed = TRUE;
}
......
......@@ -61,8 +61,6 @@ class ExpireFile implements ExpireInterface {
}
// Flush page cache for expired urls.
if (!empty($expire_urls)) {
ExpireAPI::executeExpiration($expire_urls, 'file', $file);
}
ExpireAPI::executeExpiration($expire_urls, 'file', $file);
}
}
......@@ -45,9 +45,7 @@ class ExpireMenuLink implements ExpireInterface {
}
// Flush page cache for expired urls.
if (!empty($expire_urls)) {
ExpireAPI::executeExpiration(array_unique($expire_urls), 'menu_link', $menu_link);
}
ExpireAPI::executeExpiration(array_unique($expire_urls), 'menu_link', $menu_link);
}
/**
......
......@@ -80,9 +80,7 @@ class ExpireNode implements ExpireInterface {
}
// Flush page cache for expired urls.
if (!empty($expire_urls)) {
ExpireAPI::executeExpiration($expire_urls, 'node', $node);
}
ExpireAPI::executeExpiration($expire_urls, 'node', $node);
}
/**
......
......@@ -56,9 +56,7 @@ class ExpireUser implements ExpireInterface {
}
// Flush page cache for expired urls.
if (!empty($expire_urls)) {
ExpireAPI::executeExpiration($expire_urls, 'user', $user);
}
ExpireAPI::executeExpiration($expire_urls, 'user', $user);
}
}
......@@ -98,9 +98,7 @@ class ExpireVotingapi implements ExpireInterface {
}
// Flush page cache for expired urls.
if (!empty($expire_urls)) {
ExpireAPI::executeExpiration($expire_urls, 'votingapi', $votes);
}
ExpireAPI::executeExpiration($expire_urls, 'votingapi', $votes);
$cache_flushed = TRUE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment