21282 Posts in 5730 Topics by 2601 members
General Questions
SilverStripe Forums » General Questions » Uncaught Exception: Object->__call(): the method 'subpagestocache' does not exist
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1023 Views |
-
Uncaught Exception: Object->__call(): the method 'subpagestocache' does not exist

29 March 2011 at 10:31pm
Hi,
when I start a "sake dev/buildcache flush=1" I get the error
the method 'subpagestocache' does not exist on 'CampaignPage'
We are using the StaticExporter (or trying to).
CampaignPage extends InfoPage, which extends PageLsd, which in turn extends SiteTree.Any help, where to start to look?
Thank you very much
Sven Opitz -
Re: Uncaught Exception: Object->__call(): the method 'subpagestocache' does not exist

29 March 2011 at 11:24pm
As the error says - it indicates subPagesToCache function does not exist in your page model. Check the function is in your Page class as per http://doc.silverstripe.org/sapphire/en/reference/staticpublisher#usage
-
Re: Uncaught Exception: Object->__call(): the method 'subpagestocache' does not exist

30 March 2011 at 1:47am
I checked it in Page.php and it looks fine. it works for some pages, I guess they are in some way first in line...
Could this snippet be the culprit?
class InfoPage extends PageLsd {
static $db = array(
'date' => 'Date',
'alttitle' => 'varchar(128)',
);The problem is, I can understand what to insert where, as it is in the docs, that is Copy&Paste. It does however not really explain why.
And the docs get very fast very confusing, if I try to follow them. -
Re: Uncaught Exception: Object->__call(): the method 'subpagestocache' does not exist

30 March 2011 at 5:09pm
Could you post your Page.php just so we can check? It sounds like you are unsure.
To explain why you need to have those functions the best place to understand is the actual code - https://github.com/silverstripe/silverstripe-cms/blob/master/code/staticpublisher/StaticPublisher.php.
* allPagesToCache() returns an array of all the url segments you would want to cache
* subPagesToCache you don't need to define but in that example allPagesToCache calls that function. Think of it as a helper function
* pagesAffectedByChanges is optional. If you have it you need to return an array of url segments you want to update when publishing the current page (often you'll want to also update the homepage).Hope that helps!
-
Re: Uncaught Exception: Object->__call(): the method 'subpagestocache' does not exist

30 March 2011 at 6:05pm
It certainly does.
Knowing this I can use the help files better and then find the error.Thank you!
| 1023 Views | ||
|
Page:
1
|
Go to Top |


