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

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

parent 0bf7b4d3
...@@ -76,6 +76,7 @@ class UIModelGrid ...@@ -76,6 +76,7 @@ class UIModelGrid
$row = array(); $row = array();
$row['uuid'] = $record->getAttributes()['uuid']; $row['uuid'] = $record->getAttributes()['uuid'];
foreach ($fields as $fieldname) { foreach ($fields as $fieldname) {
if ($record->$fieldname != null) {
$row[$fieldname] = $record->$fieldname->getNodeData(); $row[$fieldname] = $record->$fieldname->getNodeData();
if (is_array($row[$fieldname])) { if (is_array($row[$fieldname])) {
foreach ($row[$fieldname] as $fieldKey => $fieldValue) { foreach ($row[$fieldname] as $fieldKey => $fieldValue) {
...@@ -88,6 +89,7 @@ class UIModelGrid ...@@ -88,6 +89,7 @@ class UIModelGrid
} }
} }
} }
}
// if a search phrase is provided, use it to search in all requested fields // if a search phrase is provided, use it to search in all requested fields
if ($searchPhrase != '') { if ($searchPhrase != '') {
......
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