I have built a very simple module which just implements a block with a custom form. When submitted, the content is emailed to me. I show this block on the dashboard, and without the admin overlay it works totally fine.
But when I access the dashboard in the overlay and submit the form, I get no feedback at all (I user drupal_set_message() when the email is sent, but that doesn't show up) and half a minute later I find 437 copies of the same email in my inbox.
Unfortunately I have no idea at all where I could start debugging THIS. Maybe the overlay is just a coincidence. But what else could cause this massive submission of email and/or the form?
Any ideas are appreciated.
Thanks,
Victor
UPDATE: The (simplified) code below, this very basic form still has the same problem. How is this possible?
<?php
function mvp_form_test_block_info() {
$blocks = array(
'mvp_form_test_test_block' => array(
'info' => 'Test Form',
'cache' => DRUPAL_CACHE_GLOBAL,
'properties' => array(
'administrative' => true,
),
),
);
return $blocks;
}
function mvp_form_test_block_view($delta='') {
if ($delta != 'mvp_form_test_test_block')
return array();
return array(
'title' => 'Test Block',
'content' => drupal_get_form('mvp_form_test_test_form'),
);
}
function mvp_form_test_test_form($form, &$form_state) {
$form = array();
$form['sometext'] = array(
'#type' => 'textfield',
);
$form['button'] = array(
'#type' => 'submit',
'#value' => 'Submit',
);
return $form;
}
function mvp_form_test_test_form_submit($form, $form_state) {
watchdog('mvp_form_test', 'Form submitted with text '.$form_state['values']['sometext']);
drupal_set_message('Form submitted with text '.$form_state['values']['sometext']);
}
?>