mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
array check to ensure getRemoteJoinField() gets an array from Config::inst()->get($remoteClass, 'has_one') (related issue: #2570)
This commit is contained in:
parent
5c1a9d9da5
commit
8de1ce4a56
@ -1533,7 +1533,11 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
|||||||
return substr($remoteClass, $fieldPos + 1) . 'ID';
|
return substr($remoteClass, $fieldPos + 1) . 'ID';
|
||||||
}
|
}
|
||||||
|
|
||||||
$remoteRelations = array_flip(Config::inst()->get($remoteClass, 'has_one'));
|
$remoteRelations = Config::inst()->get($remoteClass, 'has_one');
|
||||||
|
if(!is_array($remoteRelations)) {
|
||||||
|
$remoteRelations = array();
|
||||||
|
}
|
||||||
|
$remoteRelations = array_flip($remoteRelations);
|
||||||
|
|
||||||
// look for remote has_one joins on this class or any parent classes
|
// look for remote has_one joins on this class or any parent classes
|
||||||
foreach(array_reverse(ClassInfo::ancestry($this)) as $class) {
|
foreach(array_reverse(ClassInfo::ancestry($this)) as $class) {
|
||||||
|
Loading…
Reference in New Issue
Block a user