mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge branch '3.2' into 3.3
This commit is contained in:
commit
a2581b9cf7
@ -549,18 +549,18 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler {
|
|||||||
$list->add($this->record, $extraData);
|
$list->add($this->record, $extraData);
|
||||||
} catch(ValidationException $e) {
|
} catch(ValidationException $e) {
|
||||||
$form->sessionMessage($e->getResult()->message(), 'bad', false);
|
$form->sessionMessage($e->getResult()->message(), 'bad', false);
|
||||||
$responseNegotiator = new PjaxResponseNegotiator(array(
|
if ($controller->getRequest()->isAjax()) {
|
||||||
'CurrentForm' => function() use(&$form) {
|
$responseNegotiator = new PjaxResponseNegotiator(array(
|
||||||
return $form->forTemplate();
|
'CurrentForm' => function () use (&$form) {
|
||||||
},
|
return $form->forTemplate();
|
||||||
'default' => function() use(&$controller) {
|
},
|
||||||
return $controller->redirectBack();
|
));
|
||||||
}
|
|
||||||
));
|
|
||||||
if($controller->getRequest()->isAjax()){
|
|
||||||
$controller->getRequest()->addHeader('X-Pjax', 'CurrentForm');
|
$controller->getRequest()->addHeader('X-Pjax', 'CurrentForm');
|
||||||
|
return $responseNegotiator->respond($controller->getRequest());
|
||||||
}
|
}
|
||||||
return $responseNegotiator->respond($controller->getRequest());
|
Session::set("FormInfo.{$form->FormName()}.errors", array());
|
||||||
|
Session::set("FormInfo.{$form->FormName()}.data", $form->getData());
|
||||||
|
return $controller->redirectBack();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO Save this item into the given relationship
|
// TODO Save this item into the given relationship
|
||||||
|
Loading…
x
Reference in New Issue
Block a user