From 740e3b724fe2f63fb9db362abc12aecf4e46895a Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sun, 28 Sep 2008 22:41:02 +0000 Subject: [PATCH] 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 --- tasks/RebuildStaticCacheTask.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tasks/RebuildStaticCacheTask.php b/tasks/RebuildStaticCacheTask.php index 5a31192e..14a93a9b 100644 --- a/tasks/RebuildStaticCacheTask.php +++ b/tasks/RebuildStaticCacheTask.php @@ -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();