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.

This commit is contained in:
Julian Seidenberg 2012-03-07 17:17:32 +13:00
parent 676bcbe8c0
commit febcff734c

View File

@ -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,