This has been troubleing me for a while.. When i try to hide fields like the group audience field, or the publishing setting from a form, on validation the form set both of these field to a null value, even though the defaut value as been correctly declared.
I tried to use Invisible, #access, unset hidden nothing work! This is very troubleing because for my current project users can edit only small bits of their profile at the time, for instance just the address or the picture, so if i hide group audience the user ends up kicked out of the groups he belongs at every edit.
I ended up using the code below to hide these field while still keeping the user in their group.
$variables['user_edit_about']['group_audience']= $temp['group_audience']; $variables['user_edit_about']['group_audience']['#prefix'] = '<div style="display:none;">'; $variables['user_edit_about']['group_audience']['#suffix'] = '</div>';
Would anyone think of a better way to achieve this ?