Skip to content

Commit

Permalink
Fixes #55: Ensure correct controller is used to render checkExport (#56)
Browse files Browse the repository at this point in the history
* Ensure correct controller is used to render checkExport

* Remove branch alias

Co-authored-by: Robbie Averill <robbie@silverstripe.com>
  • Loading branch information
dizzystuff and robbieaverill committed Jan 9, 2022
1 parent 686f123 commit 611f5ee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Forms/GridFieldQueuedExportButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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]);
}
}
Expand Down

0 comments on commit 611f5ee

Please sign in to comment.