Skip to content

Commit

Permalink
FIX count size of $relations
Browse files Browse the repository at this point in the history
  • Loading branch information
dhensby committed Jan 30, 2018
1 parent e23fcda commit 74a3ba5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion model/DataObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ public function update($data) {
$parentObj = $relObj;
$relObj = $relObj->$relation();
// If the intermediate relationship objects have been created, then write them
if($i<sizeof($relation)-1 && !$relObj->ID || (!$relObj->ID && $parentObj != $this)) {
if($i<sizeof($relations)-1 && !$relObj->ID || (!$relObj->ID && $parentObj != $this)) {
$relObj->write();
$relatedFieldName = $relation."ID";
$parentObj->$relatedFieldName = $relObj->ID;
Expand Down

0 comments on commit 74a3ba5

Please sign in to comment.