get error field is required when #access is false with field permission  in image field With fieldpermission module I set some permission on some fields(fields are in profile type (I used profile2 module)) ,some of them are required , showing of field is ok ,(they are not showend and #access property of them is false ). but when I save node  get field is required error to me. 
any idea?

update: after some debugging find out this problem not issued from profile2 module, problem is a bug(maybe) with image cck field and field permission. when you have image cck field and restrict it with field permission even it not showed(by #access=false ) but in submit (if it reqired) , return  the image field name is required.
any idea?
This fieldpermission bug with image and file cck field.

You can get all element in form_alter and if #access set false remove #require of it

    if ($profile_type == 'profile_main') {
    foreach($form[$profile_type] as $index=&gt;$value) {
          if (preg_match('/^field_/', $index)){
                if ($form[$profile_type][$index]['#access'] == FALSE)  
                  $form[$profile_type][$index]['und'][0]['#required']=FALSE;
          }
        }
    }