mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX: Allow opening of the detail pop-ups of a record on a ComplexTableField attached to a deleted page. (from r94593) (from r96762)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102393 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
f8163a99eb
commit
5bcfbe6622
@ -389,6 +389,21 @@ JS;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the record in which the CTF resides
|
||||
*/
|
||||
function getParentRecord() {
|
||||
if($this->form && $record = $this->form->getRecord()) {
|
||||
return $record;
|
||||
} else {
|
||||
if($this->sourceID()) {
|
||||
$parentClass = DataObject::get_by_id($this->getParentClass(), $this->sourceID());
|
||||
} else {
|
||||
$parentClass = singleton($this->getParentClass());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* (Optional) Setter for a correct parent-relation-class.
|
||||
* Defaults to the record loaded into the surrounding form as a fallback.
|
||||
@ -472,11 +487,7 @@ JS;
|
||||
function getFieldsFor($childData) {
|
||||
// See if our parent class has any many_many relations by this source class
|
||||
if($this->getParentClass()) {
|
||||
if($this->sourceID()) {
|
||||
$parentClass = DataObject::get_by_id($this->getParentClass(), $this->sourceID());
|
||||
} else {
|
||||
$parentClass = singleton($this->getParentClass());
|
||||
}
|
||||
$parentClass = $this->getParentRecord();
|
||||
|
||||
$manyManyRelations = $parentClass->many_many();
|
||||
$manyManyRelationName = null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user