Skip to content

Commit

Permalink
Make Form base class more test friendly..
Browse files Browse the repository at this point in the history
refs #5525
  • Loading branch information
Johannes Meyer committed Sep 9, 2014
1 parent c8ce108 commit f7f6bcc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions library/Icinga/Web/Form.php
Expand Up @@ -162,8 +162,9 @@ public function setRedirectUrl($url)
public function getRedirectUrl()
{
if ($this->redirectUrl === null) {
$url = Url::fromRequest(array(), $this->getRequest());
// Be sure to remove all form dependent params because we do not want to submit it again
$this->redirectUrl = Url::fromRequest()->without(array_keys($this->getElements()));
$this->redirectUrl = $url->without(array_keys($this->getElements()));
}

return $this->redirectUrl;
Expand Down Expand Up @@ -312,7 +313,7 @@ public function create(array $formData = array())
if ($this->getAction() === '') {
// We MUST set an action as JS gets confused otherwise, if
// this form is being displayed in an additional column
$this->setAction(Url::fromRequest()->getUrlWithout(array_keys($this->getElements())));
$this->setAction(Url::fromRequest()->without(array_keys($this->getElements())));
}

$this->created = true;
Expand Down

0 comments on commit f7f6bcc

Please sign in to comment.