mirror of
https://github.com/silverstripe/silverstripe-restfulserver
synced 2024-10-22 14:05:58 +02:00
FIX getFieldsForObj does not return relation classes in hasField() check
This commit is contained in:
parent
9e4b2ff59b
commit
defdc72bbd
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user