I cannot seem to get "Locale settings" fieldset to collapse using hook_form_FORM_ID_alter().
Here is what I've tried so far.
function fsrsys_form_user_profile_form_alter(&$form, &$form_state, $form_id) {
$form['timezone']['#type'] = 'fieldset';
$form['timezone']['#collapsible'] = TRUE;
$form['timezone']['#collapsed'] = TRUE;
$form['#after_build'][] = 'user_profile_form_afterbuild';
}
function user_profile_form_afterbuild($form, $form_state) {
$form['timezone']['#collapsed'] = TRUE;
//dd($form['timezone']['#collapsed']); // <-- shows '1'
return $form;
}
The fieldset is still 'open.'
For good measure, I've cleared both the Drupal cache and the browser cache twice.
What am I doing wrong?