Skip to content

Commit

Permalink
Merge pull request #204 from rotassator/fix-page-class-change
Browse files Browse the repository at this point in the history
FIX: check if base class has ElementPageExtension
  • Loading branch information
robbieaverill authored Mar 8, 2018
2 parents 1325f42 + a3ae7cb commit 0384a9a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions code/extensions/ElementPageExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,12 @@ public function onAfterDelete() {
* @return boolean
*/
public function supportsElemental() {
// check extension applied to base class (avoid error on page class change)
$base = singleton($this->owner->ClassName);
if (!$base->hasExtension(__CLASS__)) {
return false;
}

if ($this->owner->hasMethod('includeElemental')) {
$res = $this->owner->includeElemental();
if ($res !== null) {
Expand Down

0 comments on commit 0384a9a

Please sign in to comment.