Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Unexpected redirect at end of wizard

#4

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);

Reported by Brian Bosh · January 17th, 2011 @ 01:05 PM

State: new
Milestone: none
Assigned to: nobody

Activity

No comments yet.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.