mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
FIX count size of $relations
This commit is contained in:
parent
e23fcda6b6
commit
74a3ba54ae
@ -890,7 +890,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
||||
$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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user