Javascript being stripped from links with Drupal Core 7.92 release

Created on 16 September 2022, almost 2 years ago
Updated 24 March 2023, over 1 year ago

Problem/Motivation

With the Drupal Core 7.92 release the Javascript: void(); menu functionality is no longer functioning. Related to l() now strips dangerous protocols from the $path β†’

Steps to reproduce

  1. Update to Drupal Core 7.92 and latest release of Void Menu.
  2. Make menu link with void as the target
  3. Review link on page it no longer contains "Javascript" just the "Void()" function
  4. Clicking the link will try to bring up a /Void() page vs the expected dead link

Proposed resolution

Not sure this is possible as Void_Menu only updates the link path prior to I(). "Rewrite l() function when Void Menu links are displayed. So we do not need to exclude javascript as a whole from sanitization by whitelisting with filter_allowed_protocols variable."

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

1.9

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States whthat

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States cYu

    If anyone finds their way here after Drupal 7.93 and their links aren't working, the module default of "javascript: void(0);" isn't one of the special cases added and still won't work, but changing your config setting to "javascript:void(0);" by removing the space before void or using any of the following will work.

    From: https://git.drupalcode.org/project/drupal/-/commit/9a82e00

       $special_case_js_paths = array(
          'javascript:void()',
          'javascript:void();',
          'javascript:void(0)',
          'javascript:void(0);',
          'JavaScript:Void(0)'
        );
    
  • πŸ‡¨πŸ‡¦Canada joseph.olstad

    upgrade the jquery_update module and any modules that use jquery_ui

  • πŸ‡¨πŸ‡¦Canada joseph.olstad

    Chrome version 111.x
    and
    Firefox version 111.x

    recently introduced another break in functionality. It's fixed by upgrading jquery_update to the latest release and core to 7.95+ and possibly other modules might need upgrades.

  • Status changed to Active over 1 year ago
  • πŸ‡¨πŸ‡¦Canada joseph.olstad

    Review suggestions to upgrade jquery_update and core.

Production build 0.69.0 2024