I've tried to create a validation and submit functions on a custom comment form, using drupal 7.9, but it's not working, and I don't know why.
In the following code, we can see the "dpm's" in the first function, but not the "dpm's" in the last ones.
function job_form_comment_node_job_form_alter(&$form, &$form_state) {
$form['#validate'][] = 'job_comment_validate';
$form['#submit'][] = 'job_comment_submit';
dpm($form);
dpm($form_state);
}
function job_comment_validate($form, &$form_state) {
dpm($form);
dpm($form_state);
}
function job_comment_submit($form, &$form_state) {
dpm($form);
dpm($form_state);
}
if I add a #validate
or #submit
it also doesn't call others drupal hook comments like presave, insert etc.
If I comment these lines, the hooks are called, but I can't use the validation or the submission functions in this case.
Do you have any idea on why this happens?
comment_node_job_form()
function?job_from_....alter
then you have ` job_comment_validate` andjob_comment_submit
...1. whats your module name? 2. Can you post the implementation the define thecomment_node_job_form
form.. should befunction comment_node_job_form..
if you do not have, then your alter function is not altering anything ..