mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX: Fix latent bug in DataObject
This didn’t show up until we ran tests on PHP 7.3-dev
This commit is contained in:
parent
0eebeedd03
commit
0926b04512
@ -807,8 +807,8 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
||||
if ($relObj->$relation() instanceof DataObject) {
|
||||
$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 the intermediate relationship objects haven't been created, then write them
|
||||
if ($i<sizeof($relations)-1 && !$relObj->ID || (!$relObj->ID && $parentObj !== $this)) {
|
||||
$relObj->write();
|
||||
$relatedFieldName = $relation."ID";
|
||||
$parentObj->$relatedFieldName = $relObj->ID;
|
||||
|
Loading…
Reference in New Issue
Block a user