From 1ccc44232800dd368ab9a729325de58016c7f435 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Sun, 9 Jan 2022 20:29:27 +1300 Subject: [PATCH] Fixes #55: Ensure correct controller is used to render checkExport (#56) (#62) * Ensure correct controller is used to render checkExport * Remove branch alias Co-authored-by: Robbie Averill Co-authored-by: Luke Fromhold <576903+dizzystuff@users.noreply.github.com> Co-authored-by: Robbie Averill --- src/Forms/GridFieldQueuedExportButton.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Forms/GridFieldQueuedExportButton.php b/src/Forms/GridFieldQueuedExportButton.php index b73d18a..145d4f1 100644 --- a/src/Forms/GridFieldQueuedExportButton.php +++ b/src/Forms/GridFieldQueuedExportButton.php @@ -12,6 +12,7 @@ use SilverStripe\Forms\GridField\GridField_FormAction; use SilverStripe\Forms\GridField\GridField_HTMLProvider; use SilverStripe\Forms\GridField\GridField_URLHandler; +use SilverStripe\Forms\GridField\GridFieldDetailForm_ItemRequest; use SilverStripe\ORM\FieldType\DBHTMLText; use SilverStripe\Security\Security; use SilverStripe\View\ArrayData; @@ -227,6 +228,9 @@ public function checkExport($gridField, $request = null) if ($request->isAjax()) { return $return; } else { + while ($controller && $controller instanceof GridFieldDetailForm_ItemRequest) { + $controller = $controller->getController(); + } return $controller->customise(['Content' => $return]); } }