diff --git a/commons.profile b/commons.profile index 4e3f4cf..bef447c 100644 --- a/commons.profile +++ b/commons.profile @@ -200,7 +200,6 @@ function commons_create_first_group() { '#type' => 'textfield', '#title' => st("Group name"), '#description' => st('For example: "Boston food lovers" or "Engineering team."'), - '#required' => TRUE, '#default_value' => st('Engineering team'), ); @@ -208,7 +207,6 @@ function commons_create_first_group() { '#type' => 'textarea', '#title' => st('Group description'), '#description' => st("This text will appear on the group's homepage and helps new contributors to become familiar with the purpose of the group. You can always change this text or add another group later."), - '#required' => TRUE, '#default_value' => st('The online home for our Engineering team'), ); @@ -228,16 +226,18 @@ function commons_create_first_group() { function commons_create_first_group_submit($form_id, &$form_state) { $values = $form_state['values']; - $first_group = new stdClass(); - $first_group->type = 'group'; - node_object_prepare($first_group); - - $first_group->title = $values['commons_first_group_title']; - $first_group->body[LANGUAGE_NONE][0]['value'] = $values['commons_first_group_body']; - $first_group->uid = 1; - $first_group->language = LANGUAGE_NONE; - $first_group->status = 1; - node_save($first_group); + if (!empty($values['commons_first_group_title'])) { + $first_group = new stdClass(); + $first_group->type = 'group'; + node_object_prepare($first_group); + + $first_group->title = $values['commons_first_group_title']; + $first_group->body[LANGUAGE_NONE][0]['value'] = $values['commons_first_group_body']; + $first_group->uid = 1; + $first_group->language = LANGUAGE_NONE; + $first_group->status = 1; + node_save($first_group); + } } /*