From bd5abb62ff7a040a7feb265cb1f9451c7b61e00a Mon Sep 17 00:00:00 2001 From: Michael Parkhill Date: Thu, 1 May 2014 15:35:45 +1200 Subject: [PATCH] FIX: parent::init is not called first In the controller's init function, parent::init() should be called before any other method calls. --- docs/en/reference/rssfeed.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/en/reference/rssfeed.md b/docs/en/reference/rssfeed.md index b799b5c90..b10cc9eaa 100644 --- a/docs/en/reference/rssfeed.md +++ b/docs/en/reference/rssfeed.md @@ -47,6 +47,7 @@ SilverStripe what values to include in the feed. class Page_Controller extends ContentController { private static $allowed_actions = array('rss'); public function init() { + parent::init(); // linkToFeed will add an appropriate HTML link tag to the website // tag to notify web browsers that an RSS feed is available // for this page. You can include as many feeds on the page as you @@ -56,7 +57,6 @@ SilverStripe what values to include in the feed. // In this example $this->Link("rss") refers to the *rss* function // we define below. RSSFeed::linkToFeed($this->Link("rss"), "RSS feed of this blog"); - parent::init(); } public function rss() { // Creates a new RSS Feed list @@ -87,8 +87,8 @@ updates. Update mysite/code/Page.php to something like this: private static $allowed_actions = array('rss'); public function init() { - RSSFeed::linkToFeed($this->Link() . "rss", "10 Most Recently Updated Pages"); parent::init(); + RSSFeed::linkToFeed($this->Link() . "rss", "10 Most Recently Updated Pages"); } public function rss() { @@ -130,8 +130,8 @@ for all the students as we've seen before. class Page_Controller extends ContentController { private static $allowed_actions = array('students'); public function init() { - RSSFeed::linkToFeed($this->Link("students"), "Students feed"); parent::init(); + RSSFeed::linkToFeed($this->Link("students"), "Students feed"); } public function students() { $rss = new RSSFeed(