- Member | 417
I think in @dev version is a bug with method $presenter->restoreRequest().
Prepare reproducible environment:
git clone firstname.lastname@example.org:nette/examples.git cd examples/CD-collection/ composer install --prefer-dist
- Sign in into app
- Go to “Add new album” screen
- Delete all cookies via Developers Tools
- Refresh page
- You have been redirect to login form with backlink param
- After successfully re-sign in, you're in “Add new album” screen, but URI wasn't change and if you do refresh page, you get “Confirm Form Resubmission”.
The same story works fine (without form resubmission) in Nette v2.2.2.
Last edited by o5 (2014-06-27 13:02)
This behaviour is correct.
The method restoreRequest only restores the request without changing url (it can't actually change it because restoring post requests wouldn't work). The fact you got redirected before was an unintentional sideeffect caused by canonicalization in some cases (not always so it was not reliable).
We should add some method
redirectToStoredRequest() or something
like that which would ignore the post data in the stored request and
Last edited by enumag (2014-06-27 18:46)
Ignoring the fact it is masssive BC break of common use-case of most websites (and thus as well violates POST/REDIRECT/GET pattern), how do you suggest to replace the behavior? Calling restoreRequest() terminates code execution, so you can't place redirect after it. And any other way is imho hackish.
I've already explained reasons for this change on GitHub. As I've said the old behavior (although relied on by many people) was neither intended nor reliable, it was just a side-effect of other things.
Also it's not my fault that this change got into Nette 2.2. At the time I was convinced that the next version after 2.1 will be 3.0 where such BC break would be fine.
Last edited by enumag (2014-06-28 22:19)