From 8f2849f32a1bd92330a74fb7b2c628d4b207478f Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 21 Jul 2015 16:48:56 +0200 Subject: [PATCH] Form: Improve code readability.. ..and avoid the necessity to provide another mock when testing Form::handleRequest(). refs #8758 --- library/Icinga/Web/Form.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/Icinga/Web/Form.php b/library/Icinga/Web/Form.php index 4e587a148..f41672b28 100644 --- a/library/Icinga/Web/Form.php +++ b/library/Icinga/Web/Form.php @@ -965,9 +965,9 @@ class Form extends Zend_Form || ($this->onSuccess === null && false !== $this->onSuccess()))) { if (! $frameUpload) { $this->getResponse()->redirectAndExit($this->getRedirectUrl()); + } else { + $this->getView()->layout()->redirectUrl = $this->getRedirectUrl()->getAbsoluteUrl(); } - - $this->getView()->layout()->redirectUrl = $this->getRedirectUrl()->getAbsoluteUrl(); } } elseif ($this->getValidatePartial()) { // The form can't be processed but we may want to show validation errors though