Hi
I've browsed a bit but couldn't find this in the forum - apologies if it has already been covered. I'm a bit new to drupal, so go easy on me : )
I've written a module and I call the main function using the menu hook:
$items[] = array(
'path' => 'foo/bar',
'title' => t('News Filter'),
'callback' => 'foobar_filter',
'access' => user_access('access filter'),
'type' => MENU_CALLBACK,
);
and the function creates and returns content:
function foobar_filter() {
drupal_set_message(t('filter called '));
$output = drupal_get_form('foobar_filter_form');
... process POST info and perform a function which filters nodes and saves the output into $results
// LOOP
$results .= node_view($newnode , array_values($_POST['nodes']);
// LOOP
...
$output .= $results;
return $output;
}
the foobar_filter_form makes a form which basically returns an array of node ID's which I use to
produce the results. (Some code has been left out - I do check the POST variables)
The problem is this. My POST variables from the form keep vanishing - after quite a bit of time
trying to figure out I finally added the drupal_set_message to the start of the function and noticed
that the function always gets called twice when I post something (i.e. I see the message "filter called"