FIX getFieldsForObj does not return relation classes in hasField() check

This commit is contained in:
Robbie Averill 2018-02-08 16:56:07 +13:00
parent 9e4b2ff59b
commit defdc72bbd

View File

@ -301,7 +301,9 @@ abstract class DataFormatter
if (is_array($this->customFields)) { if (is_array($this->customFields)) {
foreach ($this->customFields as $fieldName) { foreach ($this->customFields as $fieldName) {
// @todo Possible security risk by making methods accessible - implement field-level security // @todo Possible security risk by making methods accessible - implement field-level security
if ($obj->hasField($fieldName) || $obj->hasMethod("get{$fieldName}")) { if (($obj->hasField($fieldName) && !is_object($obj->getField($fieldName)))
|| $obj->hasMethod("get{$fieldName}")
) {
$dbFields[$fieldName] = $fieldName; $dbFields[$fieldName] = $fieldName;
} }
} }