mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
BUGFIX: using Controller::curr instead Director::get_current_page to work with 2.3 and 2.4
This commit is contained in:
parent
dd632af9fa
commit
a2b9e2f00c
@ -38,7 +38,9 @@ class BlogTree extends Page {
|
|||||||
* - Otherwise, try and find a 'top-level' BlogTree
|
* - Otherwise, try and find a 'top-level' BlogTree
|
||||||
*/
|
*/
|
||||||
static function current() {
|
static function current() {
|
||||||
$page = Director::get_current_page();
|
|
||||||
|
$controller = Controller::curr();
|
||||||
|
if($controller) $page = $controller->data();
|
||||||
|
|
||||||
// If we _are_ a BlogTree, use us
|
// If we _are_ a BlogTree, use us
|
||||||
if ($page instanceof BlogTree) return $page;
|
if ($page instanceof BlogTree) return $page;
|
||||||
|
Loading…
Reference in New Issue
Block a user