Since Bootstrap Tour use name (check Bootstrap tour API documentation, name parameter) parameters as prefix for localstorage variable names, it is critical to have unique name for each tour after it's initialization.

This cause a problem when user ended the tour A but also tour B, C, D ... cannot be launched.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dstorozhuk’s picture

Status: Active » Needs review
tripper54’s picture

Status: Needs review » Active

Issues should not be marked 'needs review' unless a patch has been submitted for review, see https://www.drupal.org/node/156119

dstorozhuk’s picture

Version: 7.x-2.4 » 7.x-2.x-dev
Status: Active » Needs review
FileSize
707 bytes
dstorozhuk’s picture

Please disregard the #3 patch. I added unique for steps instead if tour.

dstorozhuk’s picture

dstorozhuk’s picture

Title: Tours should use their unique names when build the tour configuration » Tours should use their unique names when build the tour configuration to avoid local storage collisions

Update title.

dstorozhuk’s picture

Title: Tours should use their unique names when build the tour configuration to avoid local storage collisions » Tours not starts: tours should use their unique names when build the tour configuration to avoid local storage collisions

Update title.

dstorozhuk’s picture

Issue summary: View changes

Add link to Bootstrap tour API documentation.

m.stenta’s picture

I can confirm that this issue exists (ending one tour prevents ALL other tours from starting), and that the patch fixes the issue. I would consider this RTBC.

I am proposing one small change, however: I think we should prepend "tour_" to the name parameter, so that it is prefixed to avoid potential conflicts. I know the potential is very small, given the way they are named, but this is better practice.

Drupal 8 uses a convention for its local storage variable naming: "Drupal.[module_name].[variable_name]"... I tried doing that for this patch, but it didn't work. It looks like the Bootstrap Tour library doesn't support periods in the name.

From the link you provided in the description (emphasis mine):

This option is used to build the name of the storage item where the tour state is stored. The name should contain only alphanumerics, underscores and hyphens. You can initialize several tours with different names in the same page and application.

Ultimately, that should be fixed upstream in the library, but I think this patch will work for now.

@dstorozhuk: please review, and mark this as RTBC if you agree. :-)

candelas’s picture

Patch #9 works. Thanks a lot :)