unset form elements with hook_form_alter() I've created my module, but I have a problem when its code executes the following code:

dpm($form);


I can't see the notifications fields (from the Notifications module); also, I can't remove the "Format" fieldset from the node create page ("node/add/question"; my content type is called "question").

The following snippet works great, but is there any other method to print all the form's fieldsets? I just stuck at this notifications field set, as I can't remove it.

unset($form['menu'], $form['comment_settings']);
Notification does add its own form elements in its own hook_form_alter(), which is probably executed after yours.

Check the module weight in the {system} table, and set your module to a higher value to have it run later.

Note: Instead of using unset() to hide form elements, you should instead set the #access property to FALSE. This keeps them in the form build tree, which avoids problems if other modules try to access or alter that information.