The submit button redirects me to a wrong page, when I put something in $form['storage'] in the #submit or #validate handler of the form, and have clicked the 'preview' button
function clubmember_form(&$node, $form_state) {
$form['#submit'][] = 'xxx_node_form_submit';
$form['#validate'][] = 'xxx_node_form_validate';
.....
}
function xxx_node_form_submit($form, &$form_state) {
$form_state['storage']['test'] = true;
}
function xxx_node_form_validate($form, &$form_state) {
$form_state['storage']['test'] = true;
}
How to reproduce using poll.module?
add to the function poll_form(&$node, $form_state) the folowing line
$form['#submit'][] = 'poll_node_form_submit2';
and add the function
function poll_node_form_submit2($form, &$form_state) {
$form_state['storage']['test'] = true;
}
now goto node/add/poll
fill in some values, click 'preview' and the click 'submit'
you are not at the newly created node but you are back at node/add/poll....
same happens when using the #validate handler
Comments
Comment #1
bwynants commentedI think page http://drupal.org/node/144132 has a clue why this happens
and
but how can one use the 'storage' in node forms then?
Comment #2
dpearcefl commentedIs this still an issue using current Drupal 6?