Problem/Motivation
The <front> route name is not been used to match on route name for current route name
when a selected node had been set as the front page for the site
Steps to reproduce
Given that we have a custom tour for the home page
And we used the <front> as the route to show the tour up
When we select a node as the front page like "/node/1" for the homepage
Then the tour icon in the toolbar will not show up
as the entity.node.canonical is been returned by
// Load all of the items and match on route name.
$route_match = \Drupal::routeMatch();
$route_name = $route_match->getRouteName();
Proposed resolution
Check if the current matching path is the front page
and change the route name been passed to the tour Drupal entity query
To mach by route name not the entity.node.canonical by a node which been selected as the front page settings.
We could add
// Check if the current matching path is the front page.
if (\Drupal::service('path.matcher')->isFrontPage()) {
$route_name = '<front>';
}
As the route is more important than any other route name when the page is the front page.
Remaining tasks
User interface changes
When we configure a tour for the <front> page route
It will show up the icon for the Tour on the front page
even if we had other type of entities or selected entity as the front page.
API changes
N/A
Data model changes
N/A
Release notes snippet
N/A
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3165435-2.patch | 610 bytes | rajab natshah |
Issue fork tour-3165435
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
rajab natshahComment #3
rajab natshahComment #4
rajab natshahComment #5
rajab natshahComment #6
rajab natshahComment #7
vikashsoni commented@RajabNatshah Patch apply successfully for me
Thanks ...
Comment #8
thejimbirch commentedPatch applies cleanly, but I was unable to get the Tour to load on a node set as the home page.
Here are the steps I took to try to validate this. I may be missing something, or misconfiguring.
Comment #9
rajab natshahThanks, Jim for reviewing and testing
Using the #2 patch in
#3164237: Fix Varbase Welcome message not showing up after install compilation after adding and enabling moderation sidebar on the homepage
But using
In the tour.tour.welcome-to-varbase.yml
Not any other routes or aliases
Comment #10
thejimbirch commentedI'll try queuing another test using a custom module, rather than Tour UI.
Comment #15
quietone commentedThis extension is being deprecated, see #3336033: [Meta] Tasks to deprecate Tour module. It will be removed from core and moved to a contrib project, #3376099: [11.x] [Meta] Tasks to remove Tour.
This is now Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.
Comment #16
quietone commentedComment #17
smustgrave commentedCan we get a simple test case for this.
Comment #20
smustgrave commentedAdded a quick test. Will be included in 2.0.x