MINOR Ignore any values that come through as arrays in DataObject::cache_composite_fields()

This commit is contained in:
Sean Harvey 2012-04-20 15:24:17 +12:00
parent 58599dc9d1
commit 1683299d81

View File

@ -271,6 +271,8 @@ class DataObject extends ViewableData implements DataObjectInterface, i18nEntity
$fields = Config::inst()->get($class, 'db', Config::UNINHERITED); $fields = Config::inst()->get($class, 'db', Config::UNINHERITED);
if($fields) foreach($fields as $fieldName => $fieldClass) { if($fields) foreach($fields as $fieldName => $fieldClass) {
if(!is_string($fieldClass)) continue;
// Strip off any parameters // Strip off any parameters
$bPos = strpos('(', $fieldClass); $bPos = strpos('(', $fieldClass);
if($bPos !== FALSE) $fieldClass = substr(0,$bPos, $fieldClass); if($bPos !== FALSE) $fieldClass = substr(0,$bPos, $fieldClass);