FIX: resolve virtual page use with widgets.

When using a VirtualPage mapping to a BlogTree, widgets will bypass the instanceof BlogTree check and instead fail to find the current page.
This commit is contained in:
Will Rossiter 2014-01-28 12:24:31 +13:00
parent 6653cc2546
commit 2a25b9459c
1 changed files with 3 additions and 0 deletions

View File

@ -57,6 +57,9 @@ class BlogTree extends Page {
// If we _are_ a BlogTree, use us
if ($page instanceof BlogTree) return $page;
// If page is a virtual page use that
if($page instanceof VirtualPage && $page->CopyContentFrom() instanceof BlogTree) return $page;
// Or, if we a a BlogEntry underneath a BlogTree, use our parent
if($page->is_a("BlogEntry")) {
$parent = $page->getParent();