mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
ENHANCEMENT Added user_error() if RebuildStaticCacheTask is called without a Page->allPagesToCache() method defined
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@63198 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
a322fbd59f
commit
740e3b724f
@ -13,6 +13,14 @@ class RebuildStaticCacheTask extends Controller {
|
||||
StaticPublisher::set_echo_progress(true);
|
||||
|
||||
$page = singleton('Page');
|
||||
if(!$page->hasMethod('allPagesToCache')) {
|
||||
user_error(
|
||||
'RebuildStaticCacheTask::index(): Please define a method "allPagesToCache()" on your Page class to return all pages affected by a cache refresh.',
|
||||
E_USER_ERROR
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if($_GET['urls']) $urls = $_GET['urls'];
|
||||
else $urls = $page->allPagesToCache();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user