Problem/Motivation
Toolbar button shows "No tour" even where there is one available, and infact it opens if you click on the "No tour" button 😅.
Steps to reproduce
Fresh site install with Drupal 10.3.6 & standard profile, enable toolbar, create a simple tour at node.add route, go to /node/add, see the "No tour" in the toolbar and click it.
Issue fork tour-3484858
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
kopeboyI should point out that instead it works as expected if the (core experimental)
navigationmodule is enabled, both with and without thetoolbarmodule enalbed (which should be superflous once navigation is used).Comment #3
pooja_sharma commentedComment #4
pooja_sharma commentedThis issue is not replicate at my end, it 'll be helpful if more detail steps shared along with screencast.
Comment #5
smustgrave commentedComment #6
kopeboyI had already given the instructions to reproduce! But here it's an even simpler one:
/admin/config/user-interface/tour/manage/tour_edit)/admin/config/user-interface/tour/manage/tours]You can see the same problem on all 3 of the default tours provided, as well as new tour you might create, as I said in #1.
The problem is with the
toolbarmodule and not with thenavigationmodule. Just enable it and repeat the last 2 steps to see the problem "fixed".Comment #7
smustgrave commentedWould have to spin up a 10.3 but not seeing an issue on 11.x
Are you testing latest 2.0.x branch btw?
Comment #8
kenwest commentedHi, I had a similar issue that was marked as a duplicate of this one. I did some debugging, so I'm copying that here in case it helps shed light on this issue. My issue is that when the route is 'entity.node.edit_form' the 'bundle' parameter is both used and ignored. Looking at the code for Tour 2.0.6 ...
* The 'entity.node.edit_form' route has a parameter 'node' that is the Node entity being edited
* tour_page_bottom() discovers this at line 167 of tour.module and sets $params['bundle'] to the node's bundle. This allows the route to be matched so the tour can be added to $page_bottom. This explains why the tour is available when the toolbar button is clicked.
* On the other hand, tour_toolbar() only looks at the 'node' parameter's id() on line 94, so $no_tips is set TRUE. Then when the button is rendered LazyBuilders::renderTour() sets the text to "No tour".
My suggestion is that tour_page_bottom() and tour_toolbar() use the same code. Even better, the first function to be called should stash its results so we only need to do one entityQuery('tour'). If this is a helpful way forward I can contribute a patch.
Comment #9
smustgrave commentedSame question on #7 are you testing on 2.0.x or the tagged release 2.0.6
Comment #10
kenwest commentedI was testing 2.0.6 but I've downloaded 2.0.x and the same issue presents.
Comment #12
smustgrave commentedI am seeing the issue but surprised the pipeline is having 0 issues
Comment #13
smustgrave commentedCan't replicate on 11.0.7
But I do see on 11.1.x
Comment #14
smustgrave commentedComment #16
smustgrave commentedWe can re-open if needed but want to include in the next release, which I'm planning shortly.
Comment #17
kenwest commentedI'm continuing to experience this issue with 2.0.7 on Drupal 10.3.10.
Here is an excerpt from the YML for my tour ...
For the node.add route, the tour button says "Tour" when I'm adding a Blog, and clicking it starts the add_or_edit_a_blog tour
For the entity.node.edit_form route, the tour button says "No Tour" when I'm editing a Blog, but clicking it starts the add_or_edit_a_blog tour
Comment #18
kenwest commentedComment #19
loopy1492 commentedWe're getting it with routes in search_api on tour 2.0.6 and core 10.3.10
The routes are like:
You click the "No tour available for this page" and it actually starts the tour.
What do these routes have in common? They have parameters. Even when I specify a route, the button still displays the wrong label.
We aren't getting the issue on:
These routes do not have parameters.
Comment #20
smustgrave commentedComment #21
loopy1492 commentedTours working on pages with parameters is a feature request?
Comment #22
smustgrave commentedFrom what I can tell that was never part of what it supported. Also based on the description. So least to me seems like a feature request.
Comment #24
smustgrave commentedNeeds more test coverage but a good start.
Comment #25
smustgrave commentedWonder if anyone mind testing if this works for them? Then can add coverage for the other params
Comment #27
smustgrave commented