Hello
I am trying to build a url query string using node objects when a alter_form submit button is pressed. To do this I use a function called elertz_form_submit however I can't seem to read any of the node objects. I found out how to do it the form_alter by doing:
$node = $form['#node'];
$title= $node->title;
This does not work with my submit function.
Am I doing something very stupid?
Thank you
David
function elertz_form_alter($formid, &$form) {
$form['#submit']['elertz_form_submit'] = array();
return;
}
function elertz_form_submit($form_id, $form_values) {
$elertz_update_url = variable_get('elertz_update_url',"");
$webmaster_id = variable_get('elertz_webmaster_id',"");
$elertz_fire_password = variable_get('elertz_fire_password',"");
$elertz_notification_description = urlencode(variable_get('elertz_notification_description',""));
$schema_id = variable_get('elertz_schema_id',"");
$server_name = $_SERVER["SERVER_NAME"];
$url = $server_name.'?q=node/'.$node->uid;
$node = $form_values['#node'];
$title= urlencode($node->title);
$elertzfirestring = $elertz_update_url
.'?webmaster_id='
.$webmaster_id
.'&password='
.$elertz_fire_password
.'&url='
.$url