Problem/Motivation

The footer Copy link relied on an hx-on-click attribute and core's HTMX. Drupal core 11.4.10 strips hx* and on* attributes from rendered links, so the link has no handler and clicking it just goes to the front page.

Steps to reproduce

  1. Install The Rightup on Drupal core 11.4.10.
  2. Open any page and click the chain link icon in the footer.
  3. Nothing is copied and the browser follows the link to /.

Proposed resolution

  • Use core's HTMX (core/drupal.htmx, htmx 2.0.x in core 11.4.10). menu--social-media-menu.html.twig adds hx-on:click (copy the page address, add is-copied, announce "Link copied") and hx-on:keydown (Space) to the item whose link has the copy-link class.
  • The nav-menu SDC gains an optional per-item link_attributes, merged into the link.
  • Core 11.4.10 strips hx-* from menu link content, as htmx's security advice says to do for user content, so the handler lives only in theme markup.
  • README: hx-on uses eval, so a strict Content Security Policy needs 'unsafe-eval' in script-src.

The menu link itself changes in The Rightup recipe: #3631078.

Remaining tasks

  • ✅ File an issue
  • ✅ Addition/Change/Update/Fix
  • ✅ Testing to ensure no regression
  • ➖ Automated unit/functional testing coverage
  • ➖ Developer Documentation support
  • ➖ User Guide Documentation support
  • ➖ UX/UI designer responsibilities
  • ❌ Accessibility and Readability
  • ❌ Reviewed by a human
  • ❌ Code review by maintainers
  • ❌ Full testing and approval
  • ❌ Credit contributors
  • ❌ Review with the product owner
  • ❌ Update Release Notes
  • ❌ Release

User interface changes

  • The footer Copy link copies the page address again.

API changes

  • Optional link_attributes per item in the nav-menu component.

Data model changes

  • N/A

Release notes snippet

  • The footer Copy link works on Drupal core 11.4.10 and later, with the HTMX handler in the theme template instead of the menu link content.

AI-Generated: Yes. Drafted with Claude Code and reviewed before posting.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rajab natshah created an issue. See original summary.

rajab natshah’s picture

Issue summary: View changes

  • rajab natshah committed 9cdba061 on 1.0.x
    fix: #3631079 Add the HTMX copy handler to the Copy link in the social...
rajab natshah’s picture

Assigned: rajab natshah » Unassigned
Status: Needs review » Fixed
Issue tags: +vartheme_bs5_rightup-1.0.6

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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