Commit 3de2fa6a authored by Michael Stenta's avatar Michael Stenta
Browse files

Always redirect to the Log entity in LogForm::save().

parent 18950aa0
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -152,13 +152,7 @@ class LogForm extends ContentEntityForm {
  public function save(array $form, FormStateInterface $form_state) {
    parent::save($form, $form_state);
    $this->messenger()->addMessage($this->t('Saved the %label log.', ['%label' => $this->entity->label()]));
    $account = $this->currentUser();
    if ($account->hasPermission('access log overview')) {
      $form_state->setRedirectUrl($this->entity->toUrl('collection'));
    }
    else {
    $form_state->setRedirectUrl($this->entity->toUrl());
  }
  }

}