BUGFIX: using Controller::curr instead Director::get_current_page to work with 2.3 and 2.4

This commit is contained in:
Carlos Barberis 2009-11-18 03:00:40 +00:00
parent dd632af9fa
commit a2b9e2f00c

View File

@ -38,7 +38,9 @@ class BlogTree extends Page {
* - Otherwise, try and find a 'top-level' BlogTree
*/
static function current() {
$page = Director::get_current_page();
$controller = Controller::curr();
if($controller) $page = $controller->data();
// If we _are_ a BlogTree, use us
if ($page instanceof BlogTree) return $page;