Skip to content

Commit

Permalink
fix(page-section): Fix parent changing class
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco (Valandur) committed Mar 18, 2019
1 parent 3f85484 commit 1b86bba
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/PageSectionsExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ public function onAfterWrite()
if (!$this->owner->{$name . "ID"}) {
// Restore or create a page section if we don't have one yet
$this->restoreOrCreate($sectionName);
} else if ($this->owner->$name()->__ParentClass !== $this->owner->ClassName) {
$this->owner->$name()->__ParentClass = $this->owner->ClassName;
$this->owner->$name()->write();
}
}
}
Expand Down

0 comments on commit 1b86bba

Please sign in to comment.