Check explictly for FALSE when calling onSuccess()

This allows us to just end onSuccess() without requiring it to return TRUE
to initiate redirection.

refs #5525
This commit is contained in:
Johannes Meyer 2014-08-29 09:04:20 +02:00
parent e1329058db
commit 486104d59e
1 changed files with 3 additions and 3 deletions

View File

@ -263,7 +263,7 @@ class Form extends Zend_Form
*
* @param Request $request The valid request used to process this form
*
* @return bool Whether any redirection should take place
* @return null|bool Return FALSE in case no redirect should take place
*/
public function onSuccess(Request $request)
{
@ -403,8 +403,8 @@ class Form extends Zend_Form
$formData = $this->getRequestData($request);
if ($this->wasSent($formData)) {
$this->populate($formData); // Necessary to get isSubmitted() to work
if ($this->isSubmitted() || ! $this->getSubmitLabel()) {
if ($this->isValid($formData) && $this->onSuccess($request)) {
if (! $this->getSubmitLabel() || $this->isSubmitted()) {
if ($this->isValid($formData) && false !== $this->onSuccess($request)) {
$this->getResponse()->redirectAndExit($this->getRedirectUrl());
}
} else {