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);
|
||||
} catch(ValidationException $e) {
|
||||
$form->sessionMessage($e->getResult()->message(), 'bad', false);
|
||||
$responseNegotiator = new PjaxResponseNegotiator(array(
|
||||
'CurrentForm' => function() use(&$form) {
|
||||
return $form->forTemplate();
|
||||
},
|
||||
'default' => function() use(&$controller) {
|
||||
return $controller->redirectBack();
|
||||
}
|
||||
));
|
||||
if($controller->getRequest()->isAjax()){
|
||||
if ($controller->getRequest()->isAjax()) {
|
||||
$responseNegotiator = new PjaxResponseNegotiator(array(
|
||||
'CurrentForm' => function () use (&$form) {
|
||||
return $form->forTemplate();
|
||||
},
|
||||
));
|
||||
$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
|
||||
|
Loading…
x
Reference in New Issue
Block a user