Problem/Motivation

The tour module can be automatically started on page load by adding "?tour=1" to the URI. But in a lot of cases you only want to start the tour module once: the first time the user uses this new functionality.

Proposed resolution

Add an extra property to the yml config "show_only_once". This value can be TRUE or FALSE. When FALSE, the tour functionality does what is does in it's current state. When TRUE, the module sets a cookie for this (anonymous) user, indicating the tour has been showed (and completed). Next time when user goes to www.site.com/?tour=1, the tour won't start unless the "tour" button is clicked explicitly.

Remaining tasks

Implement new yml config property

User interface changes

None

API changes

Documentation on how to use this new property

Edit: I'm in the process of creating this patch. But I'm stuck on one thing: how can you update a config entity, without re-installing the module?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

robin.ingelbrecht created an issue. See original summary.

robin.ingelbrecht’s picture

Issue summary: View changes
shadcn’s picture

saurabh.tripathi.cs’s picture

Assigned: Unassigned » saurabh.tripathi.cs
robin.ingelbrecht’s picture

Status: Active » Needs review
FileSize
7.96 KB

Here is a first try to implement this functionality.

nod_’s picture

Status: Needs review » Needs work

I'd rather have this in localStorage. A cookie seems overkill (we had a couple of issues for removing several cookies from D7 to D8). This cookie would bust a varnish type of cache.

We can add the list of only once tour in drupalSettings and check that on the frontend. No need to involve the backend for this, especially since the tours are not actually removed from the page, they're just prevented from starting.

robin.ingelbrecht’s picture

I guess you're right. I will move the functionality to the font-end

saurabh.tripathi.cs’s picture

Assigned: saurabh.tripathi.cs » Unassigned
robin.ingelbrecht’s picture

Moved storage from cookie to localStorage.
Also added the list of tours to drupalSettings and moved backend code to frontend.

robin.ingelbrecht’s picture

Status: Needs work » Needs review
robin.ingelbrecht’s picture

sarmiliboyz’s picture

Version: 8.2.x-dev » 8.4.x-dev

current active development branch is 8.4.x-dev

jofitz’s picture

Re-rolled for 8.4.x

Status: Needs review » Needs work

The last submitted patch, 13: 2850391-13.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

ridhimaabrol24’s picture

Rerolling patch for 9.1.x

ridhimaabrol24’s picture

Trying to fix some failed tests.

ridhimaabrol24’s picture

Status: Needs work » Needs review
FileSize
7.78 KB
1010 bytes

Fixing the error.

Status: Needs review » Needs work

The last submitted patch, 23: 2850391-23.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

nod_’s picture

+++ b/core/modules/tour/config/schema/tour.schema.yml
@@ -13,6 +13,9 @@ tour.tour.*:
diff --git a/core/modules/tour/js/tour.js b/core/modules/tour/js/tour.js

the .js file is generated automatically, it is the tour.es6.js file that needs to be modified, and then run yarn run build:js. See this documentation to see all there is to know about working with js in core: https://www.drupal.org/docs/frontend-developer-tools-for-drupal-core

sd9121’s picture

sd9121’s picture

Status: Needs work » Needs review
FileSize
8.94 KB

Status: Needs review » Needs work

The last submitted patch, 27: 2850391-27.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

sd9121’s picture

Assigned: Unassigned » sd9121
raman.b’s picture

Assigned: sd9121 » Unassigned
Status: Needs work » Needs review
FileSize
12.89 KB
7.95 KB

Resolving failed tests cases and coding standard issues from #27

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

ranjith_kumar_k_u’s picture

Status: Needs review » Needs work

The last submitted patch, 36: 2850391-36.patch, failed testing. View results

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Status: Needs work » Postponed

This 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.