Post-redirect-get pattern not followed with validation errors


The examples in the Cake documentation follow the post-redirect-get pattern which allow users to hit the browser back button and avoid the dreaded Confirm Form Resubmission browser message. However, the pattern is not followed when there are validation errors. See sample code below:

} else {
$this->Flash->error(‘Missing fields’);

Following the above example allows the browser to display the flash message as well as highlight the fields that cause the error. If I add a redirect after the validation error, then I would be following the post-redirect-get pattern but validation would not work because I lose the individual field messages.

I could probably come up with some hacky custom session solution to get this to work but Im hoping there is a “Cake” way to handle this. My users are notorious for hitting the browser back button and if they had a validation error on the page, but then fixed it and got redirected to the next page, when they hit back, they get the ugly browser message.

Anybody else see this as a problem and found a solution?