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
…) (#62)

* Ensure correct controller is used to render checkExport

* Remove branch alias

Co-authored-by: Robbie Averill <[email protected]>

Co-authored-by: Luke Fromhold <[email protected]>
Co-authored-by: Robbie Averill <[email protected]>
  • Loading branch information
3 people authored Jan 9, 2022
1 parent 4efbdce commit 1ccc442
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 1ccc442

Please sign in to comment.