diff --git a/src/Application/UI/Presenter.php b/src/Application/UI/Presenter.php index de065d83a..24f9071ac 100644 --- a/src/Application/UI/Presenter.php +++ b/src/Application/UI/Presenter.php @@ -1236,7 +1236,8 @@ private function initGlobalParameters() $params = $this->request->getParameters(); if ($this->isAjax()) { $params += $this->request->getPost(); - } elseif (isset($this->request->post[self::SIGNAL_KEY])) { + } + if (isset($this->request->post[self::SIGNAL_KEY])) { $params[self::SIGNAL_KEY] = $this->request->post[self::SIGNAL_KEY]; } diff --git a/tests/Application/Presenter.parameters.phpt b/tests/Application/Presenter.parameters.phpt index e349ae917..c235feca8 100644 --- a/tests/Application/Presenter.parameters.phpt +++ b/tests/Application/Presenter.parameters.phpt @@ -87,3 +87,13 @@ test(function () { ))); Assert::same(array('', 'foo'), $presenter->getSignal()); }); + +test(function () { + //AJAX: signal in POST overwriting empty GET + $presenter = createPresenter(); + $presenter->ajax = TRUE; + $presenter->run(new Application\Request('Foo', 'POST', array('do' => NULL), array( + 'do' => 'foo' + ))); + Assert::same(array('', 'foo'), $presenter->getSignal()); +});