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
$groups = array();
foreach ($modelObj->getNodeByReference($modelData['items'])->__items as $node) {
if (!isset($node->getAttributes()['uuid'])) {
continue;
}
if ($node->$displayKey == null) {
if (!isset($node->getAttributes()['uuid']) || $node->$displayKey == null) {
continue;
}
......@@ -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();
if (isset($groups[$group])) {
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