TypeError: this.model.get('activeTour').cancel is not a function

Created on 28 August 2024, 3 months ago
Updated 19 September 2024, 2 months ago

Problem/Motivation

One detail i was able to narrow down a little further after initially observing it in โœจ Allow Tours to be taken by users that cannot access the Toolbar (e.g. anonymous users) Postponed , i just forgot taking a look into the console when i first encountered it. When i am accessing any node page in olivero, and i have no tour specific to node pages defined, i get a "take a tour of this page" button nevertheless, but clicking that button has no effect. but on click the following error gets shown in the console (The error also happens if i create a new node and add an alias and or a menu link):

Safari outputs

[Error] TypeError: this.model.get('activeTour').cancel is not a function. (In 'this.model.get('activeTour').cancel()', 'this.model.get('activeTour').cancel' is undefined)
	toggleTour (tour.js:301)
	v (backbone-min.js:1:3418)
	d (backbone-min.js:1:3083)
	u (backbone-min.js:1:904)
	(anonymous function) (backbone-min.js:1:2963)
	set (backbone-min.js:1:5492)
	onClick (tour.js:313)
	dispatch (jquery.min.js:2:38068)

Edge outputs:

tour.js?v=11.0-dev:301 
 Uncaught TypeError: this.model.get(...).cancel is not a function
    at r.toggleTour (tour.js?v=11.0-dev:301:40)
    at v (backbone.js:337:57)
    at d (backbone.js:322:19)
    at u (backbone.js:110:16)
    at r.trigger (backbone.js:312:5)
    at r.set (backbone.js:533:16)
    at r.onClick (tour.js?v=11.0-dev:313:20)
    at HTMLButtonElement.dispatch (jquery.min.js?v=4.0.0-beta.2:2:38062)
    at HTMLButtonElement.<anonymous> (jquery.min.js?v=4.0.0-beta.2:2:36042)
toggleTour	@	tour.js?v=11.0-dev:301
v	@	backbone.js:337
d	@	backbone.js:322
u	@	backbone.js:110
(anonymous)	@	backbone.js:312
set	@	backbone.js:533
onClick	@	tour.js?v=11.0-dev:313
dispatch	@	jquery.min.js?v=4.0.0-beta.2:2
(anonymous)	@	jquery.min.js?v=4.0.0-beta.2:2

While on the frontpage as well as /user/login is see the correct "no tour available for this page" button.

Steps to reproduce

  • add a tour block to the social sidebar
  • have no tour targeting any node in the front end
  • access the frontend in olivero as anonymous
  • check the frontpage as well as a few node pages as well as the user login page

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

๐Ÿ‡ฉ๐Ÿ‡ชGermany rkoller Nรผrnberg, Germany

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

Merge Requests

Comments & Activities

  • Issue created by @rkoller
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave
  • Status changed to Postponed: needs info 3 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    So I

    1. Added tour to social region
    2. Gave anonymous permission to view tour
    3. Incognito mode visited front page with no tour available

    Not seeing the issue could it have been resolved already?

  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany rkoller Nรผrnberg, Germany

    It is not resolved. i had to rebuild my setup today due to a problem in project browser that broke the entire instance. so i had to set up everything again. for anonymous users i am unable to reproduce right now but with my admin user instead. but there is a detail i havent mentioned in the issue summary (unsure if it was the case when i ran into the error the first time). anyway my setup on a fresh instance:

    1) gave all available roles, anonymous included, the permission to view tours.
    2) created a new tour with the route

    entity.node.canonical
    - node:2

    and added one tip
    3) added the tour button block to the social bar in olivero
    4) created two nodes
    5) then accessed the frontpage with admin in one window and with anon in the other. with anon i am unable to run into the error but with the admin user on the page for node 1 when i click the take a tour of this page button the second time after nothing happens the first i run into the error. the front page shows correctly the no tour available button and node 2 shows the actual tour when i click the take a tour button.

    it feels like in combination with that route

    entity.node.canonical
    - node:2

    there is something off with showing the button in the correct state every time. and when the button is shown in the wrong state then clicking the button (which should be disabled and not enabled is causing the error? added a short recording of the output (with anon which i havent added to the video there are no errors right now anymore)

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Still can't replicate

  • Status changed to Needs review 3 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    But did notice the block query was a little off

  • Status changed to RTBC 3 months ago
  • ๐Ÿ‡ฉ๐Ÿ‡ชGermany rkoller Nรผrnberg, Germany

    yay! that fixed the problem. now i am getting the disabled button on nodes that dont match the route for the tour and the console error is gone, while for the node that is matching the route the tour button is still shown and the tour is starting properly. tested in safari and edge. thanks

  • Status changed to Fixed 3 months ago
  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024