Skip to content

Commit 874dd3d

Browse files
authored
Merge pull request #69 from dnadesign/fix-redirectorpage
Redirector page gets this extension via its (content) controller but …
2 parents 19c71f1 + 5602397 commit 874dd3d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Extension/VirtualElementContentControllerExtension.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace DNADesign\ElementalVirtual\Extensions;
44

55
use DNADesign\Elemental\Models\BaseElement;
6+
use SilverStripe\CMS\Model\RedirectorPageController;
67
use SilverStripe\Core\Extension;
78

89
class VirtualElementalContentControllerExtension extends Extension
@@ -28,6 +29,11 @@ public function handleElement()
2829
if ($element && $element->canView()) {
2930
$useElement = clone $element;
3031

32+
// Don't allow this to be used on a RedirectorPage
33+
if ($this->owner instanceof RedirectorPageController) {
34+
return null;
35+
}
36+
3137
// modify the element to appear on the correct 'Page' so that
3238
// any breadcrumbs and titles are correct.
3339
$elementalAreaRelations = $this->owner->getElementalRelations();

0 commit comments

Comments
 (0)