Tour schema properties 'location' and 'attributes' deprecated

Created on 2 June 2023, almost 2 years ago
Updated 27 August 2024, 7 months ago

Problem/Motivation

Drupal\Core\Config\Schema\SchemaIncompleteException: Schema errors for tour.tour.sitemap with the following errors: tour.tour.sitemap:tips.page-title.attributes missing schema, tour.tour.sitemap:tips.page-title.location missing schema, tour.tour.sitemap:tips.message.attributes missing schema, tour.tour.sitemap:tips.message.location missing schema, tour.tour.sitemap:tips.plugins.attributes missing schema, tour.tour.sitemap:tips.plugins.location missing schema, tour.tour.sitemap:tips.plugin-display-order.attributes missing schema, tour.tour.sitemap:tips.plugin-display-order.location missing schema, tour.tour.sitemap:tips.css.attributes missing schema, tour.tour.sitemap:tips.css.location missing schema, tour.tour.sitemap:tips.save-configuration.attributes missing schema, tour.tour.sitemap:tips.save-configuration.location missing schema

Proposed resolution

The location and attributes config properties of tours have been deprecated. This is due to Tours now using the ShepherdJS library instead of jQuery Joyride. Additional details on this can be found in this change record https://www.drupal.org/node/3195234

The following changes should be made to existing tour config
Existing uses of "location" should be changed to "position". The values will need to be changed to be valid "placements" for PopperJS, such as top-start.

Existing uses of "data-class" and "data-id" within the the attributes property should be moved to "selector". These attributes were used to associate a tour tip with an item on the page. To change this, see these examples:

attributes:
data-class: 'some-class'
should instead use
selector: '.some-class'

attributes:
data-id: 'an-id'
should instead use
selector: '#an-id'

🐛 Bug report
Status

Fixed

Component

Code

Created by

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

Merge Requests

Comments & Activities

  • Issue created by @geinosky
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.x + Environment: PHP 8.1 & MariaDB 10.3.22
    last update almost 2 years ago
    22 pass
  • Status changed to Needs review almost 2 years ago
  • Status changed to Needs work over 1 year ago
  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA

    I tried this patch on a Drupal 10.1 site and it applied cleanly but didn't fix the config import.

  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA

    When exporting the config, it just moves the body values:

    diff --git a/src-drupal/config/default/tour.tour.sitemap.yml b/src-drupal/config/default/tour.tour.sitemap.yml
    index 8f90ff7..50804e4 100644
    --- a/src-drupal/config/default/tour.tour.sitemap.yml
    +++ b/src-drupal/config/default/tour.tour.sitemap.yml
    @@ -18,52 +18,52 @@ tips:
         plugin: text
         label: 'Page Title'
         weight: -100
    +    body: '<p>Define the page title that will be used on the Sitemap page. If you do not wish to display a title, leave this field blank.</p>'
         attributes:
           data-id: edit-page-title
    -    body: '<p>Define the page title that will be used on the Sitemap page. If you do not wish to display a title, leave this field blank.</p>'
         location: right
       message:
         id: message
         plugin: text
         label: 'Sitemap message'
         weight: -99
    +    body: '<p>Define a message to be displayed above the sitemap. If you do not wish to display a message, leave this field blank.</p>'
         attributes:
           data-id: edit-message-value
    -    body: '<p>Define a message to be displayed above the sitemap. If you do not wish to display a message, leave this field blank.</p>'
         location: bottom
       plugins:
         id: plugins
         plugin: text
         label: Plugins
         weight: -98
    +    body: '<p>Select which plugins to use to generate entries into the sitemap.  You will be able to configure below.</p>'
         attributes:
           data-class: 'form-item label[for="edit-enabled"]'
    -    body: '<p>Select which plugins to use to generate entries into the sitemap.  You will be able to configure below.</p>'
         location: right
       plugin-display-order:
         id: plugin-display-order
         plugin: text
         label: 'Plugin display order'
         weight: -97
    +    body: '<p>Use this section to reorder the items as they appear in the Sitemap.  Click and drag the arrow icon to reorder, or select Show row heights and you can set the weight of the items manually.  The lower the number the higher in the list it will appear.</p>'
         attributes:
           data-id: sitemap-order
    -    body: '<p>Use this section to reorder the items as they appear in the Sitemap.  Click and drag the arrow icon to reorder, or select Show row heights and you can set the weight of the items manually.  The lower the number the higher in the list it will appear.</p>'
         location: bottom
       css:
         id: css
         plugin: text
         label: 'CSS Settings'
         weight: -96
    +    body: '<p>Select this box if you wish to load the CSS file included with the module. To learn how to override or specify the CSS at the theme level, visit the <a href="https://www.drupal.org/node/2615568">documentation page</a>.</p>'
         attributes:
           data-id: edit-css
    -    body: '<p>Select this box if you wish to load the CSS file included with the module. To learn how to override or specify the CSS at the theme level, visit the <a href="https://www.drupal.org/node/2615568">documentation page</a>.</p>'
         location: top
       save-configuration:
         id: save-configuration
         plugin: text
         label: 'Save configuration'
         weight: -95
    +    body: '<p>Once you are finished configuring the sitemap settings, select Save configuration to save them.</p>'
         attributes:
           data-id: edit-actions
    -    body: '<p>Once you are finished configuring the sitemap settings, select Save configuration to save them.</p>'
         location: top
    
    
  • First commit to issue fork.
  • Status changed to Fixed 8 months ago
  • 🇨🇦Canada mparker17 UTC-4

    After rebasing, this looks good to me. Merging. Thanks @geinosky and @Kristen Pol!

  • 🇺🇸United States Kristen Pol Santa Cruz, CA, USA

    Great 🎉

  • 🇨🇦Canada mparker17 UTC-4

    Note that this change was released in sitemap-8.x-2.0-beta7 .

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024