if you use privacy and content profile for the user's profile pages and couple that with showing fields on the user registration page, if you hide a field from the registration page and it has a privacy option enabled, that option will show up on the registration page even if the field is hidden (removed)
the content_profile and content_profile_registration module's weights are lower than privacy, so the module should see if those fields are removed, its probably a combination of bad hiding (removing) from those modules with bad checking from the privacy module, but i havent checked this :-) so im not sure where it should be _fixed_ (?)
the custom code snippet below will help remove the unmatched privacy fields, run it in a custom module with a greater weight than the privacy module, it cleans up empty groups (likely resulted from this one -->>) and unmatched privacy fields
/**
* Clean a form from privacy field checkboxes without field matches.
*/
function _sitemodule_cleanup_privacy(&$parent_form, &$form) {
$has_fields = 0 ;
foreach ( $form as $key => $value ) {
if ( strpos($key, 'privacy_') === 0 ) {
$field_key = substr($key, 8) ;
if ( ! isset($form[$field_key]) ) {
unset($form[$key]) ;
}
} else if ( strpos($key, 'group_') === 0 ) {
if ( ! _sitemodule_cleanup_privacy($parent_form, $form[$key]) ) {
unset($form[$key]) ;
unset($parent_form['#content_profile_weights'][$key]) ;
} else {
$has_fields = 1 ;
}
} else if ( strpos($key, 'field_') === 0 ) {
$has_fields = 1 ;
}
}
return $has_fields ;
}
/**
* Implementation of hook_form_alter().
*/
function sitemodule_form_alter(&$form, $form_state, $form_id) {
if ( $form_id == 'user_register' ) {
_sitemodule_cleanup_privacy($form, $form) ;
.............