Commit 2f9b4d5c authored by Jos Schellevis's avatar Jos Schellevis

(mvc) check if field exists in UImodel grid helper class

parent 0bf7b4d3
......@@ -76,15 +76,17 @@ class UIModelGrid
$row = array();
$row['uuid'] = $record->getAttributes()['uuid'];
foreach ($fields as $fieldname) {
$row[$fieldname] = $record->$fieldname->getNodeData();
if (is_array($row[$fieldname])) {
foreach ($row[$fieldname] as $fieldKey => $fieldValue) {
if ($fieldValue['selected'] == 1) {
$row[$fieldname] = $fieldValue['value'];
}
}
if ($record->$fieldname != null) {
$row[$fieldname] = $record->$fieldname->getNodeData();
if (is_array($row[$fieldname])) {
$row[$fieldname] = "##Unlinked";
foreach ($row[$fieldname] as $fieldKey => $fieldValue) {
if ($fieldValue['selected'] == 1) {
$row[$fieldname] = $fieldValue['value'];
}
}
if (is_array($row[$fieldname])) {
$row[$fieldname] = "##Unlinked";
}
}
}
}
......
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