mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX Gridfield delete action back link (#5848)
Access backlink before the record is deleted
This commit is contained in:
parent
12e32debc4
commit
6c37532a7a
@ -598,6 +598,7 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler {
|
||||
|
||||
public function doDelete($data, $form) {
|
||||
$title = $this->record->Title;
|
||||
$backLink = $this->getBacklink();
|
||||
try {
|
||||
if (!$this->record->canDelete()) {
|
||||
throw new ValidationException(
|
||||
@ -628,7 +629,7 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler {
|
||||
$controller = $this->getToplevelController();
|
||||
$controller->getRequest()->addHeader('X-Pjax', 'Content'); // Force a content refresh
|
||||
|
||||
return $controller->redirect($this->getBacklink(), 302); //redirect back to admin section
|
||||
return $controller->redirect($backLink, 302); //redirect back to admin section
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user