You are here

function group_membership_form_submit in Group 7

Group membership edit submit callback.

File

forms/group_membership.inc, line 63
Group membership editing UI.

Code

function group_membership_form_submit($form, &$form_state) {
  $group_membership = entity_ui_form_submit_build_entity($form, $form_state);

  // If roles were edited, change and save them.
  if (!empty($form_state['values']['roles'])) {
    $group_membership
      ->changeRoles($form_state['values']['roles']);
  }
  else {
    $group_membership
      ->save();
  }
  drupal_set_message(t('The membership was successfully edited.'));
}