- Issue created by @Bhanu951
Dialog is not triggered when "Enforce auto logout on admin pages" is unchecked only, it happens because code:
// We need a backup plan if JS is disabled. if (!$is_altlogout && !$refresh_only && isset($_SESSION['autologout_last'])) { // If time since last access is > timeout + padding, log them out. $diff = $now - $_SESSION['autologout_last']; if ($diff >= ($timeout + (int) $timeout_padding)) { $autologout_manager->logout(); // User has changed so force Drupal to remake decisions based on user. global $theme, $theme_key; drupal_static_reset();
I suppose it's because there is a bug in
$refresh_only = $autologout_manager->refreshOnly();
which leadsfunction autologout_autologout_refresh_only() { if (!\Drupal::config('autologout.settings')->get('enforce_admin') && \Drupal::service('router.admin_context')->isAdminRoute(\Drupal::routeMatch()->getRouteObject())) { return TRUE; }
to be executed, and
\Drupal::service('router.admin_context')->isAdminRoute(\Drupal::routeMatch()->getRouteObject())
returns FALSE even for admin pages.(
\Drupal::routeMatch()->getRouteObject()
is NULL)
It is caused by event priority$events[KernelEvents::REQUEST][] = ['onRequest', 100];
.
When I remove it, it starts to working as expected and\Drupal::routeMatch()->getRouteObject()
returns object. I don't have time to debug it more today, but it may be good start to resolve this issue.