Commit c998907e authored by Franco Fichtner's avatar Franco Fichtner

mvc: feedback from @adschellevis, and fully skip elements without groupKey

parent ed66e872
...@@ -99,11 +99,7 @@ class ModelRelationField extends BaseField ...@@ -99,11 +99,7 @@ class ModelRelationField extends BaseField
$groups = array(); $groups = array();
foreach ($modelObj->getNodeByReference($modelData['items'])->__items as $node) { foreach ($modelObj->getNodeByReference($modelData['items'])->__items as $node) {
if (!isset($node->getAttributes()['uuid'])) { if (!isset($node->getAttributes()['uuid']) || $node->$displayKey == null) {
continue;
}
if ($node->$displayKey == null) {
continue; continue;
} }
...@@ -116,7 +112,10 @@ class ModelRelationField extends BaseField ...@@ -116,7 +112,10 @@ class ModelRelationField extends BaseField
} }
} }
if (!empty($groupKey) && $node->$groupKey != null) { if (!empty($groupKey)) {
if ($node->$groupKey == null) {
continue;
}
$group = $node->$groupKey->__toString(); $group = $node->$groupKey->__toString();
if (isset($groups[$group])) { if (isset($groups[$group])) {
continue; continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment