lib: Fix JSON response exception on form failure
This commit is contained in:
parent
e07e16d7a1
commit
4593c78d16
|
@ -1171,10 +1171,9 @@ class Form extends Zend_Form
|
|||
$this->getView()->layout()->redirectUrl = $this->getRedirectUrl()->getAbsoluteUrl();
|
||||
}
|
||||
} elseif ($this->getIsApiTarget()) {
|
||||
$this->getResponse()->sendJson(array(
|
||||
'status' => 'fail',
|
||||
'data' => array_merge($this->getMessages(), $this->getErrorMessages())
|
||||
));
|
||||
$this->getResponse()->json()->setFailData(
|
||||
array_merge($this->getMessages(), $this->getErrorMessages())
|
||||
)->sendResponse();
|
||||
}
|
||||
} elseif ($this->getValidatePartial()) {
|
||||
// The form can't be processed but we may want to show validation errors though
|
||||
|
|
Loading…
Reference in New Issue