When using finish path and finishing the wizard the page is not redirected. However using $form_state['redirect'] inside the finish callback does work. Isn't the purpose of finish path to make the usage of $form_state['redirect'] obsolete or something different?

My finish callback:

/**
 * Callback generated when the add page process is finished.
 */
function linodef_taglists_wizard_add_finish(&$form_state) {
  $taglist = &$form_state['taglist'];

  // Create a real object from the cache.
  linodef_taglists_wizard_add_save($taglist);

  // Clear the cache.
  linodef_taglists_clear_cache($form_state['cache name']);

  //$form_state['redirect'] = 'admin/settings/linodef/taglists';
}

Cancel path works for the cancel submit button but not for the finish submit.

CommentFileSizeAuthor
#2 ctools_wizard.inc_cancelpath.patch702 bytesRoi Danton
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

merlinofchaos’s picture

Category: support » bug

Hm. finish path should work the same way cancel path does. This may be a bug.

Roi Danton’s picture

Title: Wizard: How to use finish/cancel path for finish callback » Wizard: Cancel path not heeded in finish callback
Status: Active » Needs review
FileSize
702 bytes

I mixed up 'return path' with (not existing) 'finish path' - 'return path' works as intended. However the cancel path doesn't work as promised in help/wizard.html:

If it is not present and needed, the cancel path will also be checked.

Therefore here is a patch which heeds the cancel path on every finish submit if return path is not set.

merlinofchaos’s picture

Status: Needs review » Fixed

Committed! Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.