Fixes an issue where success is still called when AJAX validation fails
This commit is contained in:
parent
88b138e0d7
commit
1728295f3f
|
|
@ -339,7 +339,7 @@ class Controller extends Extendable
|
||||||
$responseContents = [];
|
$responseContents = [];
|
||||||
$responseContents['#layout-flash-messages'] = $this->makeLayoutPartial('flash_messages');
|
$responseContents['#layout-flash-messages'] = $this->makeLayoutPartial('flash_messages');
|
||||||
$responseContents['X_OCTOBER_ERROR_FIELDS'] = $ex->getFields();
|
$responseContents['X_OCTOBER_ERROR_FIELDS'] = $ex->getFields();
|
||||||
return Response::make()->setContent($responseContents);
|
return Response::make($responseContents, 406);
|
||||||
}
|
}
|
||||||
catch (Exception $ex) {
|
catch (Exception $ex) {
|
||||||
Log::error($ex);
|
Log::error($ex);
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,7 @@ if (window.jQuery === undefined)
|
||||||
var _event = jQuery.Event('ajaxErrorMessage')
|
var _event = jQuery.Event('ajaxErrorMessage')
|
||||||
$(window).trigger(_event, [message])
|
$(window).trigger(_event, [message])
|
||||||
if (_event.isDefaultPrevented()) return
|
if (_event.isDefaultPrevented()) return
|
||||||
alert(message)
|
if (message) alert(message)
|
||||||
},
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
|
|
@ -256,6 +256,9 @@ class PluginManager
|
||||||
if (!isset($this->plugins[$identifier]))
|
if (!isset($this->plugins[$identifier]))
|
||||||
$identifier = $this->normalizeIdentifier($identifier);
|
$identifier = $this->normalizeIdentifier($identifier);
|
||||||
|
|
||||||
|
if (!isset($this->plugins[$identifier]))
|
||||||
|
return null;
|
||||||
|
|
||||||
return $this->plugins[$identifier];
|
return $this->plugins[$identifier];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue