I have a wizard of 5 steps:
function beforeFilter() {
$this->Wizard->steps = array('user', 'profile', 'term',
'payment', 'confirm'); $this->Wizard->completeUrl =
"/users/complete"; $this->Wizard->wizardAction = "join";
}
The final step, confirm, has this process hook:
function _processConfirm() {
debug("made it to process for confirm");
return true;
}
Which runs as expected. However, following that code running,
Wizard attempts a redirect to /users/join. I expect it to redirect
to /users/complete. Having added that debug() to _processConfirm,
CakePHP started throwing an error:
Warning (2): Cannot modify header information - headers already
sent by ....
Viewing the stack trace, it unwinds to
WizardComponent::process() -
APP/plugins/wizard/controllers/components/wizard.php, line 245
if ($proceed) {
$this->save(); if (next($this->steps)) {
if ($this->autoAdvance) {
$this->redirect();
}
$this->redirect(current($this->steps));
} else {
$this->Session->write('Wizard.complete', $this->read());
$this->reset();
$this->controller->redirect($this->wizardAction); // Line 245
} }
I assume that line should read
$this->controller->redirect($this->completeUrl);