mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Removed extra lookup of the list
This commit is contained in:
parent
af3a9f3ec8
commit
36198c482e
@ -586,8 +586,7 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
|
|||||||
$relations = $sourceObject->$name();
|
$relations = $sourceObject->$name();
|
||||||
if ($relations) {
|
if ($relations) {
|
||||||
if ($relations instanceOf ManyManyList) { //many-to-many relation
|
if ($relations instanceOf ManyManyList) { //many-to-many relation
|
||||||
$source = $sourceObject->getManyManyComponents($name);
|
$extraFieldNames = $relations->getExtraFields();
|
||||||
$extraFieldNames = $source->getExtraFields();
|
|
||||||
|
|
||||||
if ($relations->Count() > 0) { //with more than one thing it is related to
|
if ($relations->Count() > 0) { //with more than one thing it is related to
|
||||||
foreach($relations as $relation) {
|
foreach($relations as $relation) {
|
||||||
|
Loading…
Reference in New Issue
Block a user