From 09554b27b46554b2ff04ea76cab017e90d04da91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Maa=C3=9F?= Date: Sat, 2 Feb 2013 13:45:52 +0100 Subject: [PATCH] NEW: Added a callback before writing the record for the first time, allowing the corresponding DataObject to execute code related to the current gridField. --- code/GridFieldBulkImageUpload_Request.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/GridFieldBulkImageUpload_Request.php b/code/GridFieldBulkImageUpload_Request.php index 32bcec0..2622a90 100644 --- a/code/GridFieldBulkImageUpload_Request.php +++ b/code/GridFieldBulkImageUpload_Request.php @@ -264,6 +264,9 @@ class GridFieldBulkImageUpload_Request extends RequestHandler { $record = Object::create($recordClass); $record->setField($recordForeignKey, $recordForeignID); + // passes the current gridfield-instance to a call-back method on the new object + $record->extend("onBulkImageUpload", $this->gridField); + $record->write(); $upload = new Upload();