7 – How to use element validation and form validation on the same form?

I have a custom form that I validate with a custom validation function like this:

...
$ form['submit'] = table (
& # 39; # type & # 39; => & # 39;
& # 39; # value & # 39; => t (& # 39; Submit & # 39;),
& # 39; # validate & # 39; => array (& # 39; custom_misc_form_validate & # 39;),
)

It works as expected, my custom validation function is called, and so on. But I would like to add an additional form element to the form, which defines an element validation callback function, like this:

$ form['email'] = table (
& # 39; # type & # 39; => & # 39; textfield & # 39 ;,
& # 39; # title & # 39; => t ('Email'),
& # 39; # description & # 39; => & # 39; Thank you very much kindly send an e-mail to the following address: An diese Address werden Ihnen die Zugangsdaten zu unserem intranet zugesandt.
& # 39; # required & # 39; => TRUE,
& # 39; # element_validate & # 39; => array (& # 39; custom_misc_email_validate & # 39;),
& # 39; # weight & # 39; => -998,
)

The validation reminder looks like this:

function custom_misc_email_validate ($ element, & $ form_state, $ form) {
$ value = $ element['#value'];

// Check if the email has a valid format.
if (! valid_email_address ($ value)) {
form_error ($ element, t (% mail address% mail is not valid., array (% mail = $ value)) );

// Check if the email address is already registered.
} elseif (user_load_by_mail ($ value)) {
form_error ($ element, t (The email address% email is already registered. Have you forgotten your password?& # 39 ;, array (% email => $ value, @password => url (user & password) )));
}
}

But the reminder for element validation is not called, as long as there is a reminder in #validate the submission button. As soon as it is commented, the reminder of the validation of the element is called, but $ element['#value'] is always empty

Is it a bug or am I doing something wrong?