I have a managed_file #upload_validators callback and when it is called the $form_state does not get passed along with it. My goal is to use another field in the form to rename the uploaded file. I just need access to that during the validation. Maybe I shouldn't be using a validator callback for renaming the file and displaying in the UI immediately but this but it is all I can think of at the moment.
It appears we can use this code to get the $form_state, however, there are no $form_state['values'].
$form_state = form_state_defaults(); // $form_state is passed by reference and will be updated automatically. form_get_cache($_REQUEST['form_build_id'], $form_state);
I was able to find the value in
However, this will not pass along the value you set in another field without first setting an #ajax callback on that field, the callback can just return NULL, it is just to update the form.
In our case we disable the file upload field until the other field has first been set.
Hopefully this will help someone or most likely myself in a year from now.