Loading login_destination.module +8 −8 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ function login_destination_user_logout(AccountInterface $account) { * Implements hook_form_FORM_ID_alter() for user_form(). */ function login_destination_form_user_form_alter(array &$form, FormStateInterface $form_state) { if (isset($_GET['pass-reset-token'])) { if (\Drupal::request()->query->get('pass-reset-token') !== NULL) { // If the query parameter 'pass-reset-token' is set, it is assumed that the // user just used a one-time login url. // If we add the $form_state['redirect'] here it will be overriden by Loading Loading @@ -129,14 +129,14 @@ function login_destination_toolbar_alter(&$items) { function login_destination_link_alter(&$variables) { $routes = [ 'user.login', 'user.logout' 'user.logout', ]; /* @var Drupal\Core\Url $url */ /** @var Drupal\Core\Url $url */ $url = $variables['url']; if ($url->isRouted() && in_array($url->getRouteName(), $routes)) { // Get current path. $current = \Drupal::service('path.current')->getPath(); $variables['options']['query']['current'] = $current; $current = \Drupal::request()->getpathInfo(); /*with lang prefix*/ $variables['options']['query']['destination'] = $current; } } Loading Loading @@ -169,7 +169,7 @@ function login_destination_entity_presave(EntityInterface $entity) { * User Account. */ function login_destination_perform_redirect($trigger, AccountInterface $account) { /* @var Drupal\login_destination\LoginDestinationManager $service */ /** @var Drupal\login_destination\LoginDestinationManager $service */ $service = \Drupal::service('login_destination.manager'); $destination = $service->findDestination($trigger, $account); if ($destination) { Loading src/Form/LoginDestinationRuleForm.php +1 −0 Original line number Diff line number Diff line Loading @@ -260,6 +260,7 @@ class LoginDestinationRuleForm extends EntityForm { * * @return string * Returns a $displayable_string for the URI. * * @see LinkWidget::getUriAsDisplayableString() */ protected function getUriAsDisplayableString($uri) { Loading tests/src/Functional/RedirectTest.php +0 −1 Original line number Diff line number Diff line Loading @@ -69,7 +69,6 @@ class RedirectTest extends BrowserTestBase { */ protected function drupalLogout() { // Make a request to the logout page. $assert_session = $this->assertSession(); $this->drupalGet('user/logout'); // @see BrowserTestBase::drupalUserIsLoggedIn() Loading Loading
login_destination.module +8 −8 Original line number Diff line number Diff line Loading @@ -70,7 +70,7 @@ function login_destination_user_logout(AccountInterface $account) { * Implements hook_form_FORM_ID_alter() for user_form(). */ function login_destination_form_user_form_alter(array &$form, FormStateInterface $form_state) { if (isset($_GET['pass-reset-token'])) { if (\Drupal::request()->query->get('pass-reset-token') !== NULL) { // If the query parameter 'pass-reset-token' is set, it is assumed that the // user just used a one-time login url. // If we add the $form_state['redirect'] here it will be overriden by Loading Loading @@ -129,14 +129,14 @@ function login_destination_toolbar_alter(&$items) { function login_destination_link_alter(&$variables) { $routes = [ 'user.login', 'user.logout' 'user.logout', ]; /* @var Drupal\Core\Url $url */ /** @var Drupal\Core\Url $url */ $url = $variables['url']; if ($url->isRouted() && in_array($url->getRouteName(), $routes)) { // Get current path. $current = \Drupal::service('path.current')->getPath(); $variables['options']['query']['current'] = $current; $current = \Drupal::request()->getpathInfo(); /*with lang prefix*/ $variables['options']['query']['destination'] = $current; } } Loading Loading @@ -169,7 +169,7 @@ function login_destination_entity_presave(EntityInterface $entity) { * User Account. */ function login_destination_perform_redirect($trigger, AccountInterface $account) { /* @var Drupal\login_destination\LoginDestinationManager $service */ /** @var Drupal\login_destination\LoginDestinationManager $service */ $service = \Drupal::service('login_destination.manager'); $destination = $service->findDestination($trigger, $account); if ($destination) { Loading
src/Form/LoginDestinationRuleForm.php +1 −0 Original line number Diff line number Diff line Loading @@ -260,6 +260,7 @@ class LoginDestinationRuleForm extends EntityForm { * * @return string * Returns a $displayable_string for the URI. * * @see LinkWidget::getUriAsDisplayableString() */ protected function getUriAsDisplayableString($uri) { Loading
tests/src/Functional/RedirectTest.php +0 −1 Original line number Diff line number Diff line Loading @@ -69,7 +69,6 @@ class RedirectTest extends BrowserTestBase { */ protected function drupalLogout() { // Make a request to the logout page. $assert_session = $this->assertSession(); $this->drupalGet('user/logout'); // @see BrowserTestBase::drupalUserIsLoggedIn() Loading