Skip to content

Commit

Permalink
UI\Presenter, Form: parameter 'do' is passed via POST data (BC break)
Browse files Browse the repository at this point in the history
This is experimental solution. It is BC break because now it is not possible to have input named 'do'.
  • Loading branch information
dg committed Jun 17, 2013
1 parent 4b56af7 commit 1f492cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Application/UI/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,7 @@ protected function attached($presenter)
}

if (!$this->getAction()) {
$this->setAction(new Link(
$presenter,
$name . self::NAME_SEPARATOR . 'submit!',
array()
));
$this->setAction(new Link($presenter, 'this', array()));
}

if (iterator_count($this->getControls()) && $this->isSubmitted()) {
Expand All @@ -81,6 +77,10 @@ protected function attached($presenter)
}
}
}

$signal = new Nette\Forms\Controls\HiddenField;
$signal->setValue($name . self::NAME_SEPARATOR . 'submit')->setOmitted()->setHtmlId(FALSE)->unmonitor('Nette\Forms\Form');
$this[Presenter::SIGNAL_KEY] = $signal;
}
parent::attached($presenter);
}
Expand Down
2 changes: 2 additions & 0 deletions src/Application/UI/Presenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -1267,6 +1267,8 @@ private function initGlobalParameters()
$params = $this->request->getParameters();
if ($this->isAjax()) {
$params += $this->request->getPost();
} elseif (isset($this->request->post[self::SIGNAL_KEY])) {
$params[self::SIGNAL_KEY] = $this->request->post[self::SIGNAL_KEY];
}

foreach ($params as $key => $value) {
Expand Down

0 comments on commit 1f492cf

Please sign in to comment.