From febcff734c71848be857cac68681bdefb13eb65f Mon Sep 17 00:00:00 2001 From: Julian Seidenberg Date: Wed, 7 Mar 2012 17:17:32 +1300 Subject: [PATCH] BUGFIX: SSF-30 redirect action that sends an edit form back to the root of assets after making a change like changing the parentID of a file, or deleting it. Basically, any action that makes the existing URL reference obsolete. --- forms/gridfield/GridFieldPopupForms.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/forms/gridfield/GridFieldPopupForms.php b/forms/gridfield/GridFieldPopupForms.php index 70dd8c6fd..71ad52cd2 100755 --- a/forms/gridfield/GridFieldPopupForms.php +++ b/forms/gridfield/GridFieldPopupForms.php @@ -216,7 +216,12 @@ class GridFieldPopupForm_ItemRequest extends RequestHandler { * @return Form */ function ItemEditForm() { - if (empty($this->record)) return null; + if (empty($this->record)) { + $controller = Controller::curr(); + $noActionURL = $controller->removeAction($_REQUEST['url']); + $controller->getResponse()->removeHeader('Location'); //clear the existing redirect + return Director::redirect($noActionURL, 302); + } $form = new Form( $this,