I have a form, which is a default block-administration form. It's the standard form people use to edit block contents, visibility etc. When the user saves the form, drupal redirects the user to the block admin page.
Now, i want to take the user to another page, eg. the home page, after submitting a block-administration form. There are several ways to achieve this, but drupal recommends using the hook_alter_form method as described here
I've written a .module file called 'formdest' containing the following:
function formdest_form_alter(&$form, $form_state, $form_id) {
switch ($form_id) {
case 'block-admin-configure':
$form_state['redirect'] = '/home';
break;
}
}
and the .info file to accompany it:
; $Id: custom.info,v 1.0 2011/01/01 21:55:00 author Exp $
name = formdest
description = form destination
package = Other
core = 6.x
version = "6.x"
project = "custom"
datestamp = "1229018427"
My custom module shows up in the module list and I can enable it, thus activiting the redirect. But when I test it, drupal still takes me to the block admin page instead of to the homepage..
There are no error messages in neither firebug or system log, so I'm a bit clueless. Any of you coding gods has any ideas?