Skip to content

Commit

Permalink
Presenter: mix GET & POST params in AJAX only when signal is not pres…
Browse files Browse the repository at this point in the history
…ent [Closes nette/forms#33][Closes nette/nette#1061]
  • Loading branch information
dg committed Apr 1, 2016
1 parent 3f8f9bd commit 74fe94e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Application/UI/Presenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -1222,11 +1222,13 @@ private function initGlobalParameters()
$selfParams = [];

$params = $this->request->getParameters();
if ($this->isAjax()) {

$postSignal = $this->request->getPost(self::SIGNAL_KEY);
if ($this->isAjax() && !Nette\Utils\Strings::endsWith($postSignal, self::NAME_SEPARATOR . 'submit')) {
$params += $this->request->getPost();
}
if (($tmp = $this->request->getPost(self::SIGNAL_KEY)) !== NULL) {
$params[self::SIGNAL_KEY] = $tmp;
if ($postSignal !== NULL) {
$params[self::SIGNAL_KEY] = $postSignal;
}

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

0 comments on commit 74fe94e

Please sign in to comment.