Skip to content
Snippets Groups Projects

Fix JS error in Drupal.behaviors.activeLinks (escape queryString in selector).

Closes #3464340

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
22 22 attach(context) {
23 23 // Start by finding all potentially active links.
24 24 const path = drupalSettings.path;
25 const queryString = JSON.stringify(path.currentQuery);
26 const querySelector = path.currentQuery
27 ? `[data-drupal-link-query='${queryString}']`
25 const queryString = path.currentQuery
26 ? JSON.stringify(path.currentQuery)
27 : null;
  • Hervé Donner added 88 commits

    added 88 commits

    • 99507f73...07abb808 - 84 commits from branch project:11.x
    • 76890b83 - Add test (reveal JS error from Drupal.behaviors.activeLinks).
    • 47fcc5c5 - Fix JS error in Drupal.behaviors.activeLinks (escape queryString in selector).
    • fe3a8112 - Use CSS.escape.
    • 58c169f8 - Combine statements.

    Compare with previous version

  • 22 22 attach(context) {
    23 23 // Start by finding all potentially active links.
    24 24 const path = drupalSettings.path;
    25 const queryString = JSON.stringify(path.currentQuery);
    26 25 const querySelector = path.currentQuery
    27 ? `[data-drupal-link-query='${queryString}']`
    26 ? `[data-drupal-link-query="${CSS.escape(JSON.stringify(path.currentQuery))}"]`
  • added 1 commit

    Compare with previous version

  • Please register or sign in to reply
    Loading