mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Stricter checking that a relation exists on ComplexTableField::saveComplexTableField()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@106755 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
3dc526c00f
commit
b999ca4c72
@ -650,16 +650,16 @@ JS;
|
||||
if(isset($data['ctf']['manyManyRelation'])) {
|
||||
$parentRecord = DataObject::get_by_id($data['ctf']['parentClass'], (int) $data['ctf']['sourceID']);
|
||||
$relationName = $data['ctf']['manyManyRelation'];
|
||||
$componentSet = $parentRecord->getManyManyComponents($relationName);
|
||||
$componentSet->add($childData);
|
||||
$componentSet = $parentRecord ? $parentRecord->getManyManyComponents($relationName) : null;
|
||||
if($componentSet) $componentSet->add($childData);
|
||||
}
|
||||
|
||||
if(isset($data['ctf']['hasManyRelation'])) {
|
||||
$parentRecord = DataObject::get_by_id($data['ctf']['parentClass'], (int) $data['ctf']['sourceID']);
|
||||
$relationName = $data['ctf']['hasManyRelation'];
|
||||
|
||||
$componentSet = $parentRecord->getComponents($relationName);
|
||||
$componentSet->add($childData);
|
||||
$componentSet = $parentRecord ? $parentRecord->getComponents($relationName) : null;
|
||||
if($componentSet) $componentSet->add($childData);
|
||||
}
|
||||
|
||||
$referrer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null;
|
||||
|
Loading…
Reference in New Issue
Block a user