In using this great module, I noticed that the form generated by the form_alter function is not collapsed. So when creating a new node, the request to "Enable signups for this %node_type" is not collapsed like the other implementations of hook_form_alter. It kind of sticks out like a sore thumb, whatever that means.

I am sorry that I do not know how to create a patch, but I can describe the simple change. The code, beginning with line 274 reads:

elseif (user_access('admin signups')) {
      $form['signup_enable'] = array('#type' => 'checkbox', '#title' => t('Enable signups for this %node_type', array('%node_type' => node_get_name($form['type']['#value']))));
      return $form;

It can simply be amended to:

 elseif (user_access('admin signups')) {
      $form['collapse'] = array(
      '#type' => 'fieldset',
      '#title' => t('Allow signups'),
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
      '#weight' => 30,
      );
      $form['collapse']['signup_enable'] = array('#type' => 'checkbox', '#title' => t('Enable signups for this %node_type', array('%node_type' => node_get_name($form['type']['#value']))));
      return $form;

All this does is add the form whose type is 'fieldset' and collapses it.

If I need to do something else to help make this change, just let me know.

CommentFileSizeAuthor
#1 signup_node_settings_collapsable.patch2.11 KBdww

Comments

dww’s picture

Title: Form is not collapsed in node creation » signup settings are not collapsed in node creation
Assigned: Unassigned » dww
Status: Active » Fixed
StatusFileSize
new2.11 KB

thanks for the report. i modified the code you proposed and commited this to HEAD (revision 1.55) and DRUPAL-4-7 (revision 1.45.2.9). if you're interested, i'm attaching the patch i committed.

-derek

p.s. testing the solution to this issue made me notice http://drupal.org/node/67509, which should also be fixed.

monjohn’s picture

It works great! Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)