You are here

function opigno_learning_path_group_membership_form_submit in Opigno Learning path 3.x

Same name and namespace in other branches
  1. 8 opigno_learning_path.module \opigno_learning_path_group_membership_form_submit()

Adds redirect after user join group.

Clear cache if user join/leave group by himself.

1 string reference to 'opigno_learning_path_group_membership_form_submit'
opigno_learning_path_form_alter in ./opigno_learning_path.module
Implements hook_form_alter().

File

./opigno_learning_path.module, line 1519
Contains opigno_learning_path.module.

Code

function opigno_learning_path_group_membership_form_submit(array $form, FormStateInterface $form_state) {
  if ($group = $form_state
    ->get('group')) {
    $form_state
      ->setRedirect('entity.group.canonical', [
      'group' => $group
        ->id(),
    ]);
  }
}