Tour does not clean up overlay and URL for non-admin users after end tour

Created on 24 June 2025, 26 days ago

Problem:

When using the Tour module (2.x) on Drupal 10.5.0 (not tested on 11.x), everything works as expected for admin users. A tour was created and successfully displayed on a specific page.
However, when a test user with only the access tour permission runs the same tour, the following issue occurs:
At the last step, clicking "End tour" causes the popup to disappear, but:

  • The dark overlay remains on the screen.
  • The ?tour=1 parameter stays in the URL.
  • The following JavaScript error appears in the browser console:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'focus')

Steps to reproduce:

  • Install Drupal 10.5.0 and enable the Tour module (2.x).
  • Create a tour for a specific route (e.g. entity.node.canonical).
  • Create a new user role with only the access tour permission.
  • Log in as a user with this role and navigate to the page where the tour is defined.
  • Run the tour and click "End tour" at the last step.

Expected result:

  • The overlay disappears.
  • The ?tour=1 parameter is removed from the URL.
  • No JS errors occur.

Actual result:

  • The overlay stays visible.
  • The URL is not cleaned up.
  • A JS error appears in the console.

Environment:

  • Drupal 10.5.0
  • Tour module 2.x
  • Tested with latest Chrome and Firefox

Note:

This issue does not occur when logged in as an administrator.

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡¨πŸ‡­Switzerland zilloww

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024