Skip to content

Commit

Permalink
Merge pull request #199 from cjsewell/patch-1
Browse files Browse the repository at this point in the history
Write owner class only if updated
  • Loading branch information
robbieaverill authored Mar 5, 2018
2 parents 11ef192 + 9dc20ae commit 6049d50
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Models/ElementalArea.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,10 @@ public function getOwnerPage()
$page = Versioned::get_by_stage($class, Versioned::DRAFT)->filter($areaID, $this->ID);

if ($page && $page->exists()) {
$this->OwnerClassName = $class;
$this->write();
if ($this->OwnerClassName !== $class) {
$this->OwnerClassName = $class;
$this->write();
}

return $page->first();
}
Expand Down

0 comments on commit 6049d50

Please sign in to comment.