You do not need to pass the $form
and $form_state
in most* forms.
Try this:
function registration_register_form(){
instead of:
function registration_register_form($form, &$form_state){
Background: drupal_get_form
passes any given parameters to registration_register_form()
but in registration_all()
, you don't pass any extra arguments. (Just the callback of the form function).
Note that you still need to pass $form
and $form_state
in submit function as registration_register_form_submit()
uses $form_state's data.
*most cases:
if your form is a multistep form and the form changes on $form_state
variable's values, that's a good use case that you do need to pass $form and $form_state to registration_register_form()
Update
After checking your code, I found many errors.
See new revision: http://pastebin.com/VNa3veFR (unlisted)
I have corrected most of the problems I could note. See inline comments and comment blocks above function names.