From 86e27736635a7a4e3a32b907d93e336805fcaf5d Mon Sep 17 00:00:00 2001 From: colymba Date: Thu, 19 Jul 2012 15:54:19 +0300 Subject: [PATCH] Test if a field is returned by getCMSFields() Should not happen unless the field was manually removed within getCMSFields() --- code/GridFieldBulkImageUpload_Request.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/GridFieldBulkImageUpload_Request.php b/code/GridFieldBulkImageUpload_Request.php index ed30582..365a1bc 100644 --- a/code/GridFieldBulkImageUpload_Request.php +++ b/code/GridFieldBulkImageUpload_Request.php @@ -311,7 +311,10 @@ class GridFieldBulkImageUpload_Request extends RequestHandler { $recordEditableFieldsForms = array(); foreach ( $this->getRecordEditableFields() as $editableFieldName ) { - array_push($recordEditableFieldsForms, $this->parseFieldHTMLWithRecordID($this->getFieldEditForm($editableFieldName)->FieldHolder(), $record->ID) ); + $formField = $this->getFieldEditForm($editableFieldName); + if ( $formField ) { + array_push($recordEditableFieldsForms, $this->parseFieldHTMLWithRecordID($formField->FieldHolder(), $record->ID) ); + } } // Collect all output data.