Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

after $form->setAction(), destination presenter throws exception #33

Closed
iinfo-dev-mk opened this issue Sep 26, 2014 · 4 comments
Closed

Comments

@iinfo-dev-mk
Copy link

In version 2.2:

I have PageWithFormPresenter::actionDefault with this code

$form = $this["orderForm"];
$form->setAction($this->link(":Result:", "paramValue"));

/**
* @return UI\Form
*/
public function createComponentOrderForm() {
}

When form is submitted to destination url, presenter which serves this url (ResultPresenter) throws the BadSignalException with "The signal receiver component 'orderForm' is not found".

This worked without any error in 2.1. It's related to change in form submit url and "do" parameter in POST data, which was introduced in 2.2

@Majkl578
Copy link
Contributor

I wonder what is a use case for this...
Anyway, you should be using Nette\Forms\Form, not Nette\Application\UI\Form, if you want to mess with form behavior and not use automatic signal-driven submitting.

@iinfo-dev-mk
Copy link
Author

What I observe, the reason for such use case is avoiding session usage. If form handling is made in same presenter session is needed.

Maybe replacing UI\Form with Form\Form will enough, I don't know, thank you for tip anyway.

The main problem is that use case worked fine in 2.1 and doesn't work in 2.2. We have many forms with setAction and it's time consuming to verify all these places. This is definitely BC break.

And finally there is currently (in 2.2+) no sense to use setAction in Ul\Form. Mostly - if another then "this" presenter is used - it doesn't work, throws exception. Solution can be disabling the call setAction in UI\Form anyway or throw exception. I think current behavior needs some adjustment.

@ondrejmirtes
Copy link
Contributor

@dg dg closed this as completed in 8df9520 Oct 26, 2014
@dg
Copy link
Member

dg commented Oct 26, 2014

It this use case you should definitely use Nette\Forms\Form instead of UI\Form.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants