When I am adding new node by
admin/content/node-type/story, there are a lot of settings ordered by groups: Submission form settings, workflow setting, comment settings. But all these fieldsets are all by default collapsed.
My question is: how to make them all default to expanded?
I believe you have one of two options...
$form['the_form_fieldset']['#collapsed'] = FALSE;
Hope that helps!
Apart from implementing
hook_form_alter() to collapse the form fieldsets present in the node edit form, you can also install and use the Fieldset helper, which is a module that remember the status of the fieldsets, and restore it every time the page containing them is viewed; this means that if you collapse a fieldset, that fieldset will be always shown as collapsed.
As alternative, you can install Override Node Options that, as secondary feature, it also allows selected field sets to be set as collapsed and/or collapsible.