mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
commit
c6c187b083
@ -28,9 +28,16 @@ class CMSForm extends Form {
|
||||
protected function getValidationErrorResponse() {
|
||||
$request = $this->getRequest();
|
||||
$negotiator = $this->getResponseNegotiator();
|
||||
|
||||
if($request->isAjax() && $negotiator) {
|
||||
$negotiator->setResponse(new SS_HTTPResponse($this));
|
||||
return $negotiator->respond($request);
|
||||
$this->setupFormErrors();
|
||||
$result = $this->forTemplate();
|
||||
|
||||
return $negotiator->respond($request, array(
|
||||
'CurrentForm' => function() use($result) {
|
||||
return $result;
|
||||
}
|
||||
));
|
||||
} else {
|
||||
return parent::getValidationErrorResponse();
|
||||
}
|
||||
|
@ -93,7 +93,7 @@
|
||||
var firstTabWithErrors = this.find('.message.validation:first').closest('.tab');
|
||||
$('.cms-container').clearCurrentTabState(); // clear state to avoid override later on
|
||||
this.redraw();
|
||||
firstTabWithErrors.closest('.cms-tabset').tabs('select', firstTabWithErrors.attr('id'));
|
||||
firstTabWithErrors.closest('.ss-tabset').tabs('select', firstTabWithErrors.attr('id'));
|
||||
}
|
||||
|
||||
this._super();
|
||||
|
Loading…
Reference in New Issue
Block a user