From 26690ba84d89ea3f8776511692491feae511ede3 Mon Sep 17 00:00:00 2001 From: colymba Date: Thu, 19 Jul 2012 15:50:23 +0300 Subject: [PATCH] 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() --- code/GridFieldBulkImageUpload_Request.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/code/GridFieldBulkImageUpload_Request.php b/code/GridFieldBulkImageUpload_Request.php index 8d1f9e4..ed30582 100644 --- a/code/GridFieldBulkImageUpload_Request.php +++ b/code/GridFieldBulkImageUpload_Request.php @@ -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; } /**