Skip to content

Commit

Permalink
Merge pull request #161 from mak001/bugfix-area-relation-name
Browse files Browse the repository at this point in the history
Fixes getAreaRelationName() always returning the same relation
  • Loading branch information
robbieaverill authored Mar 6, 2018
2 parents 6049d50 + e00fe4a commit a70fbd6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Models/BaseElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@ public function getAreaRelationName()
if ($page instanceof BaseElement && $relationName === 'Parent') {
continue;
}
if ($relationClass === $area->ClassName) {
if ($relationClass === $area->ClassName && $page->{$relationName}()->ID === $area->ID) {
return $relationName;
}
}
Expand Down

0 comments on commit a70fbd6

Please sign in to comment.