FIX: formFields were not return in nested set

fieldByName() doesn't work in nested sets (i.e. when Tabs are used). If
no field is return this is now coupled with dataFields()
This commit is contained in:
colymba 2012-07-19 15:50:23 +03:00
parent 8a4066bef9
commit 26690ba84d
1 changed files with 8 additions and 1 deletions

View File

@ -149,9 +149,16 @@ class GridFieldBulkImageUpload_Request extends RequestHandler {
if ( !$this->recordCMSFieldList ) {
$recordClass = $this->gridField->list->dataClass;
$this->recordCMSFieldList = singleton($recordClass)->getCMSFields();
}
$field = $this->recordCMSFieldList->fieldByName($fieldName);
if ( !$field ) {
$fields = $this->recordCMSFieldList->dataFields();
$field = $fields[$fieldName];
}
return $this->recordCMSFieldList->fieldByName($fieldName);
return $field;
}
/**