Form submits should return a destination path, not do a drupal_goto

robertDouglass - August 21, 2007 - 10:09
Project:AutoPilot
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

<?php
function autopilot_add_target_form_submit($form_id, $form_values) {
 
// check for target with duplicate name
  //
 
if (autopilot_get_target(array("name" => $form_values['name'])) && !$form_values['tid']) {
   
drupal_set_message("name", "The Target with name {$form_values['name']} already exists.  Please select another.");
    return
drupal_get_form($form_id);
  }
 
autopilot_save_target($form_values);
 
drupal_goto("admin/autopilot/configure");
}
?>

you can just return 'admin/autopilot/configure'. Doing drupal_goto manually actually creates bugs.

#1

akalsey - October 9, 2008 - 21:35
Status:active» fixed

Fixed in beta-1

#2

Anonymous (not verified) - October 23, 2008 - 21:42
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.