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();
|
$this->getView()->layout()->redirectUrl = $this->getRedirectUrl()->getAbsoluteUrl();
|
||||||
}
|
}
|
||||||
} elseif ($this->getIsApiTarget()) {
|
} elseif ($this->getIsApiTarget()) {
|
||||||
$this->getResponse()->sendJson(array(
|
$this->getResponse()->json()->setFailData(
|
||||||
'status' => 'fail',
|
array_merge($this->getMessages(), $this->getErrorMessages())
|
||||||
'data' => array_merge($this->getMessages(), $this->getErrorMessages())
|
)->sendResponse();
|
||||||
));
|
|
||||||
}
|
}
|
||||||
} elseif ($this->getValidatePartial()) {
|
} elseif ($this->getValidatePartial()) {
|
||||||
// The form can't be processed but we may want to show validation errors though
|
// The form can't be processed but we may want to show validation errors though
|
||||||
|
|
Loading…
Reference in New Issue