diff --git a/code/BlogHolder.php b/code/BlogHolder.php index 4baa508..d297ee7 100644 --- a/code/BlogHolder.php +++ b/code/BlogHolder.php @@ -199,8 +199,8 @@ class BlogHolder_Controller extends BlogTree_Controller { $id = 0; - if(Director::urlParam('ID')) { - $id = (int) Director::urlParam('ID'); + if($this->request->latestParam('ID')) { + $id = (int) $this->request->latestParam('ID'); } $codeparser = new BBCodeParser(); diff --git a/code/BlogTree.php b/code/BlogTree.php index 0d0860a..70e0aaa 100644 --- a/code/BlogTree.php +++ b/code/BlogTree.php @@ -152,6 +152,7 @@ class BlogTree extends Page { * @return DataObjectSet */ public function Entries($limit = '', $tag = '', $date = '', $retrieveCallback = null, $filter = '') { + $tagCheck = ''; $dateCheck = ''; @@ -199,7 +200,7 @@ class BlogTree extends Page { // By specifying a callback, you can alter the SQL, or sort on something other than date. if($retrieveCallback) return call_user_func($retrieveCallback, 'BlogEntry', $filter, $limit, $order); - + return DataObject::get('BlogEntry', $filter, $order, '', $limit); } } @@ -290,7 +291,7 @@ class BlogTree_Controller extends Page_Controller { * @return String */ function SelectedTag() { - return (Director::urlParam('Action') == 'tag') ? Director::urlParam('ID') : ''; + return ($this->request->latestParam('Action') == 'tag') ? $this->request->latestParam('ID') : ''; } /** @@ -299,9 +300,9 @@ class BlogTree_Controller extends Page_Controller { * @return Date */ function SelectedDate() { - if(Director::urlParam('Action') == 'date') { - $year = Director::urlParam('ID'); - $month = Director::urlParam('OtherID'); + if($this->request->latestParam('Action') == 'date') { + $year = $this->request->latestParam('ID'); + $month = $this->request->latestParam('OtherID'); if(is_numeric($year) && is_numeric($month) && $month < 13) { $date = new Date();